File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes The wrapper class, Void Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "The wrapper class, Void" Watch "The wrapper class, Void" New topic
Author

The wrapper class, Void

Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

What can the wrapper class, Void, be used for? It seems to me that null would handle anything that I might want to use Void for.

-- Kaydell
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Java has the reflection API, which allows a running JVM to ask about the classes it contains, and about their methods and their fields. If you ask the reflection API what type a void method returns, it will return the static field Void.TYPE . That is the only purpose of the Void class.


[Jess in Action][AskingGoodQuestions]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: The wrapper class, Void