aspose file tools*
The moose likes Beginning Java and the fly likes What is the usage of java.lang.Void Wrapper class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is the usage of java.lang.Void Wrapper class?" Watch "What is the usage of java.lang.Void Wrapper class?" New topic
Author

What is the usage of java.lang.Void Wrapper class?

Puneet Nayyar
Greenhorn

Joined: Feb 02, 2006
Posts: 18
Hi,

I am unable to find a scenario where java.lang.Void wrapper class can be used. Can you please help me in finding where java.lang.Void wrapper class can be used in my code?

Thanks,
Puneet
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
One use - possibly the only one - is as the object returned by java.lang.reflect.Method.getReturnType(), for a method with void return type.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Srikanth Ramu
Ranch Hand

Joined: Feb 20, 2007
Posts: 76
You can search for "java.lang.Void" in this forum as it has been discussed earlier. Basically you may understand it while getting the return type of a void method using reflection api.
[ April 11, 2007: Message edited by: srikanth ramu ]
Gavin Tranter
Ranch Hand

Joined: Jan 01, 2007
Posts: 333
Is it not also used in JNI to represent void return types from the native layer (assuming the native layer is C/C++).
Been awhile since I have used JNI.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the usage of java.lang.Void Wrapper class?