File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.Void

 
Arjun Reddy
Ranch Hand
Posts: 629
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

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

Thanks.
 
Henry Wong
author
Marshal
Pie
Posts: 20828
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Arjun Reddy
Ranch Hand
Posts: 629
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Henry. Can you give me an example in code if possible?
 
Henry Wong
author
Marshal
Pie
Posts: 20828
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 629
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will do that Henry Thanks.
 
Bert Bates
author
Sheriff
Posts: 8898
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For anyone who is focused on the SCJP exam, you can relax - none of this is on any version of the exam.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20369
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic