• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The wrapper class, Void

 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic