Vidyalelo
Java Programming · Q23

Java Autoboxing

Programming · Java Programming · question 23

Q23

What happens if you try to unbox a `null` reference in Java?

A.
It throws a `ClassCastException`
B.
It returns `null`
C.
It throws a `NullPointerException`
Answer
D.
It returns the default value for the primitive type

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board