Boxing Andautngo Box
Boxing Andautngo Box
types and their corresponding object wrapper classes. For example, converting an int to an
Integer, a double to a Double, and so on. If the conversion goes the other way, this is called
unboxing.
Autoboxing and boxing are one and the same.
Unboxing is the reverse of boxing.
unboxing is the conversion from the wrapper class to the primitive data type.
BoXing
..
Advantages of Autoboxing / Unboxing:
Autoboxing and unboxing lets developers write cleaner code, making it easier to read.
The technique let us use primitive types and Wrapper class objects interchangeably and
we do not need to perform any typecasting explicitly.
The basic difference between Boxing and Unboxing is that Boxing is the conversion of the
value type to an object type whereas, on other hands, the term Unboxing refers to the
conversion of the object type to the value type. Answer: Unboxing is the conversion form the
wrapper class to the primitive data type.