| Author |
java.lang.Void wrapper class
|
Manish Hatwalne
Ranch Hand
Joined: Sep 22, 2001
Posts: 2573
|
|
JQPlus Question ID :955326363480 Which of the following are wrapper classes for primitive types? (Choose 1) Options a) String b) Void c) null d) Object e) None of the above Answer and Explanation e) None of the above Frequently it is necessary to represent a value of primitive type as if it were an object. There are following wrapper classes for this purpose: Boolean, Byte, Character, Short, Integer, Long, Float, and Double . Note that Byte, Short, Integer, Long, Float and Double extend from Number which is an abstract class. An object of type Double, for example, contains a field whose type is double, representing that value in such a way that a reference to it can be stored in a variable of reference type. These classes also provide a number of methods for converting among primitive values, as well as supporting such standard methods as equals and hashCode. Doubts But in the Java API (I have 1.2 API), it is given that - The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the primitive Java type void. What's is the right answer? TIA, - Manish
|
 |
Valentin Crettaz
Gold Digger
Sheriff
Joined: Aug 26, 2001
Posts: 7610
|
|
this is what we call a doc bug. void is not a primitive type. Refer to this discussion where we discussed that issue some time ago. http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=24&t=013732
|
SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
|
 |
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
|
|
|
HTH :)
|
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
|
 |
Manish Hatwalne
Ranch Hand
Joined: Sep 22, 2001
Posts: 2573
|
|
It does help Thanks a ton, both of you. It seems the API documentation also has quite a few bugs, I managed to find a few in IO as well Ravish, I like ur signature, though never noticed it before, I have been following it, believe me on this one Thanks, - Manish
|
 |
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
|
|
Originally posted by Manish Hatwalne: I have been following it, believe me on this one
Thats why you like it
|
 |
 |
|
|
subject: java.lang.Void wrapper class
|
|
|