Computer Applications
Answer
The automatic conversion of primitive data type into an object of its equivalent wrapper class is known as Autoboxing. For example, the below statement shows the conversion of an int to an Integer.
Integer a = 20;
Here, the int value 20 is autoboxed into the wrapper class Integer variable myinteger.
Auto-unboxing is the reverse process of Autoboxing. It is the automatic conversion of a wrapper class object into its corresponding primitive type. For example,
Integer myinteger = 20;
int myint = myinteger;
Here, the object myInteger is automatically unboxed into primitive type int variable myint when the assignment takes place.