ICSE Class 10 Computer Applications Question 22 of 30

Solved 2024 Question Paper ICSE Class 10 Computer Applications — Question 27

Back to all questions
27
Question

Question 2(vii)

Differentiate between boxing and unboxing.

Answer

Differences between boxing and unboxing are:

BoxingUnboxing
It is the process of converting a primitive type to its corresponding wrapper class object.It is the process of converting a wrapper class object back to its corresponding primitive type.
It occurs when assigning a primitive value to a wrapper object.It occurs when assigning a wrapper object to a primitive variable.
Example:
int num = 10;
Integer obj = num;
Example:
Integer obj = 20;
int num = obj;