wood burning stoves*
The moose likes Beginning Java and the fly likes class Void Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class Void" Watch "class Void" New topic
Author

class Void

chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

Can you explain me the functionality of class Void.I read the documentation and it says "The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the primitive Java type void. "

I didnt understand what they meant by "uninstantiable placeholer class"

If anyone can explain me with an example then it will be very nice .

Regards,
Chander


Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18538
    
  40

Originally posted by chander shivdasani:
Can you explain me the functionality of class Void.I read the documentation and it says "The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the primitive Java type void. "

I didnt understand what they meant by "uninstantiable placeholer class"

If anyone can explain me with an example then it will be very nice .

Regards,
Chander



"unintantiable" means you can't instantiate one -- its constructors are private. "place holder" means it's purpose is to hold something -- in this case, the Class object for the void type.

As for an example, you need to understand the reflection libraries first (Or at least the Class class type). A code example would be meaningless without it.

Henry
[ December 15, 2008: Message edited by: Henry Wong ]

Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: class Void
 
Similar Threads
what for Void class?
About Wrapper Classes
What is the point of java.lang.Void.
static methods
how to create a class like