Q: Automatic conversion of primitive data into an object of wrapper class is called:
-
A
autoboxing
-
B
explicit conversion
-
C
shifting
-
D
none of these
A
Answer:
A
Explanation:
Automatic conversion of primitive data into an object of a wrapper class is called autoboxing.
Explanation:
- Autoboxing is a feature in Java that allows automatic conversion between primitive types (such as
int, float, double, etc.) and their corresponding wrapper classes (such as Integer, Float, Double, etc.).
- For example, Java automatically converts an
int to an Integer when it is assigned to an Integer object or used in a context where an Integer is expected.
Correct Answer:
a) autoboxing
Related Topic:
Share Above MCQ