Computer Applications
What is autoboxing ? What is auto-unboxing ? How are these useful ?
Java Library Classes
10 Likes
Answer
The automatic conversion of primitive data type into an object of its equivalent wrapper class is known as Autoboxing.
The automatic conversion of an object of wrapper class into primitive data type is known as Auto-unboxing.
These are useful as:
- Autoboxing/auto-unboxing let us use primitive types and wrapper class objects interchangeably.
- It simplifies the process of converting between primitive types and their corresponding wrapper classes as the compiler does it automatically.
Answered By
7 Likes
Related Questions
When do the numeric wrapper class constructors raise NumberFormatException ?
Name some methods that are commonly available in all wrapper classes and in all numeric wrapper classes.
Which methods return primitive values from Wrapper class objects?
Which methods return Wrapper class objects from primitive values ?