Wrapper Classes
6.Which wrapper class is used for char type?
-
A. Char
-
B. Character
-
C. String
-
D. CharWrapper
Character
Character
7.What is the output?
Integer i = null;
int j = i;
System.out.println(j);
-
A. 0
-
B. null
-
C. Compilation error
-
D. NullPointerException
NullPointerException
NullPointerException
8.Which of the following is true about valueOf()?
-
A. It returns primitive values
-
B. It is only for int
-
C. It returns wrapper objects
-
D. It is deprecated
It returns wrapper objects
It returns wrapper objects
9. What is the output?
Character ch = 'A';
System.out.println(Character.isLetter(ch));
-
A. true
-
B. false
-
C. Compilation error
-
D. 65
true
true
10. What will be the output?
Double d = Double.parseDouble("12.5");
System.out.println(d + 1.5);
-
A. 14.0
-
B. 13
-
C. 12.5
-
D. Error
14.0
14.0