aspose file tools*
The moose likes Beginning Java and the fly likes java.lang.Void Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java.lang.Void" Watch "java.lang.Void" New topic
Author

java.lang.Void

Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
Hi all,

Can someone please give me a sample example on how to use java.lang.Void class??

Thanks.


Be Humble... Be Nice.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18825
    
  40

Its main use is as part of the reflection libraries. There is a static Class instance variable which is used to represent a void return value.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
Thanks for the reply Henry. Can you give me an example in code if possible?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18825
    
  40

Well, if you know how to use the reflection libraries, then you should know how to use the Void class. (considering all it is, is a place holder for the void class type)

If you don't know how to use the reflection libraries, maybe the Sun reflection tutorial is a good place to start.

http://java.sun.com/docs/books/tutorial/reflect/index.html

Henry
Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
I will do that Henry Thanks.
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8815
    
    5
For anyone who is focused on the SCJP exam, you can relax - none of this is on any version of the exam.


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
You are the Author of the HeadFirst and certification Java books right wow.. nice to meet you sir. Thanks for the reply.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

That's Bert alright. The guy helped me pass both my SCJP exams
Well, with Kathy Sierra of course, who is also a member of this board.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.Void