In API
"The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the Java keyword void."
java.lang.Void
be used? If the class is "uninstantiable", what use is it?java.lang.Void
and void
?The only point of Void
is to hold Void.TYPE
, which is sort of like void.class
. If you have a reflective reference to a method that returns void
, and you get its return type, it'll return Void.TYPE
.
You cannot, and should not, use it for anything else.