Programming - Wrapper Classes
You Are Here :: Home > JAVA > Wrapper Classes - General Questions
13. |
The ___________ method accepts a String argument and returns an int
|
A. |
parseInt() |
B.
|
parseChar() |
C.
|
parseString()
|
D.
|
parseFloat()
|
|
Answer: Option A
Explanation:
The parseInt() method accepts a String argument and returns an int |
|
14. |
The ____________ method converts a String to an int
|
A. |
parseInt() |
B.
|
parseChar() |
C.
|
parseString()
|
D.
|
parseFloat()
|
|
Answer: Option A
Explanation:
The parseInt() method converts a String to an int |
|
15. |
All the wrapper classes are declared ____________.
|
A. |
Final |
B.
|
Static |
C.
|
Non-Static
|
D.
|
abstract
|
|
Answer: Option A
Explanation:
All the wrapper classes are declared final. |
|
16. |
All wrapper classes offers static ___________ methods which give you another approach to creating wrapper objects.
|
A. |
parseInt() |
B.
|
set(object,int) |
C.
|
get()
|
D.
|
valueOf()
|
|
Answer: Option D
Explanation:
All wrapper classes offers static valueOf() methods which give you another approach to creating wrapper objects. |
|
17. |
The valueOf(…) method in the Character class accepts only char as an ________________.
|
A. |
variable |
B.
|
arguments |
C.
|
parameters
|
D.
|
methods
|
|
Answer: Option B
Explanation:
The valueOf(…) method in the Character class accepts only char as an argument |
|
18. |
_______________ returns the named primitive.
|
A. |
parseInt() |
B.
|
parsexx() |
C.
|
parseXxx()
|
D.
|
parseXx()
|
|
Answer: Option C
Explanation:
parseXxx() returns the named primitive. |
|
« prev
next »