Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Puneet Nayyar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One use - possibly the only one - is as the object returned by java.lang.reflect.Method.getReturnType(), for a method with void return type.
 
Srikanth Ramu
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic