*
The moose likes Beginning Java and the fly likes Void Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Void Class" Watch "Void Class" New topic
Author

Void Class

anil kumar bolisetti
Greenhorn

Joined: Jan 05, 2005
Posts: 6
What is the Usage of Void Class
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

The Javadoc explains that "The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the Java keyword void.". The reflection API is a set of classes and methods that let you find out things about Java classes at runtime -- i.e., you can ask what methods a class has, what its superclass is, etc. You can also ask what a method's return type is, what its argument types are, etc.

If you ask what a method's return type is, and that method returns void, you get the static final member Void.TYPE . That is the only purpose of the Void class.


[Jess in Action][AskingGoodQuestions]
anil kumar bolisetti
Greenhorn

Joined: Jan 05, 2005
Posts: 6
Thank you very much Ernest for the information given.
If possible can you give an example how can we use it.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Here's a simple example. You can learn more about reflection in the Reflection Tutorial.


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Void Class
 
Similar Threads
void
Void class
can't run
Difference between
Void is Wrapper Class