File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.Void wrapper class

 
Manish Hatwalne
Ranch Hand
Posts: 2591
Android Firefox Browser Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7610
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
R K Singh
Ranch Hand
Posts: 5382
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTH :)
 
Manish Hatwalne
Ranch Hand
Posts: 2591
Android Firefox Browser Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5382
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Manish Hatwalne:
I have been following it, believe me on this one

Thats why you like it
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic