Answer & Solution
Answer: Option D
Solution:
Autounboxing in Java refers to the automatic conversion of a wrapper class object to its corresponding primitive type.
For example, converting an
Integer object to an
int, or a
Double object to a
double.
Let's examine the options:
Option A: String text = "Hello"; — This is just assigning a String literal to a String variable, not related to autounboxing.
Option B: int value = Integer.parseInt("42"); — This parses a String to a primitive
int, but it does not involve autounboxing because no wrapper object is involved.
Option C: Double result = 3.14; — This is an example of
autoboxing (primitive to wrapper), not autounboxing.
Since none of the options demonstrate converting a wrapper object to a primitive type, the correct answer is
None of These.