This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes For the purpose of the exam.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "For the purpose of the exam.." Watch "For the purpose of the exam.." New topic
Author

For the purpose of the exam..

chafule razgul
Ranch Hand

Joined: Feb 09, 2002
Posts: 63
Is void a Java primitive type??
In the API java.lang.Void describes "The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the primitive Java type void." but in the JLS void is not included.
For the exam, should i stick to the JLS?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
You are looking at two different uses of the word. Lower case v void is the method modifier that signifies no return value, it is not a primitive. Upper case V Void is - as you found - a placeholder used in reflection. I dunno why the JavaDocs say:
the primitive Java type void.

since void is not a primitive type.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
We discussed that issue some times ago in the following thread: http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=24&t=013732
As far as I am concerned I think the reason why the API tells that is because of a silly cut-and-paste made by the guy who wrote the class java.lang.Void.
my $.2


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
chafule razgul
Ranch Hand

Joined: Feb 09, 2002
Posts: 63
Thank you William & Valentin, this really soothes the nerves..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: For the purpose of the exam..