Programming - Wrapper Classes
You Are Here :: Home > JAVA > Wrapper Classes - General Questions
19. |
_________________ returns a newly created wrapped object of the type that invoked the method.
|
A. |
valueOf() |
B.
|
IntValueOF() |
C.
|
valueof()
|
D.
|
ValOf()
|
|
Answer: Option A
Explanation:
valueOf() returns a newly created wrapped object of the type that invoked the method. |
|
20. |
The class Object, the super class of all classes, has a _________________ method.
|
A. |
toString() |
B.
|
toInt() |
C.
|
toChar()
|
D.
|
toFloat()
|
|
Answer: Option A
Explanation:
The class Object, the super class of all classes, has a toString() method. |
|
21. |
__________________ classes for converting simple types
|
A. |
Abstract |
B.
|
Static |
C.
|
Wrapper
|
D.
|
Final
|
|
Answer: Option C
Explanation:
Wrapper classes for converting simple types |
|
22. |
Converting Object numbers to Primitive numbers using _________________ method
|
A. |
typeValue() |
B.
|
constructor |
C.
|
toString()
|
D.
|
ValueOf()
|
|
Answer: Option A
Explanation:
Converting Object numbers to Primitive numbers using typeValue() method |
|
23. |
Converting primitive numbers to Object numbers using ________________ methods
|
A. |
typeValue() |
B.
|
constructor |
C.
|
toString()
|
D.
|
valueOf()
|
|
Answer: Option B
Explanation:
Converting primitive numbers to Object numbers using constructor methods |
|
24. |
Converting Numbers to Strings using ___________________ method
|
A. |
typeValue() |
B.
|
constructor |
C.
|
toString()
|
D.
|
valueOf()
|
|
Answer: Option C
Explanation:
Converting Numbers to Strings using toString() method |
|
« prev
next »