Autoboxing and Unboxing in Wrapper Classes
Topics
Advertisements
- Autoboxing
- Unboxing
CISCE: Class 10
Autoboxing:
1. Autoboxing
The automatic conversion of a primitive data type into an object of its equivalent wrapper class is known as Autoboxing.
Syntax: <Wrapper class> <object> = new <Wrapper class>(Primitive Value)
CISCE: Class 10
Unboxing:
Unboxing is the opposite of autoboxing. It is a system for converting an object of a wrapper class into a primitive data type.
Syntax: <Primitive Data Type> <variable> = <Wrapper object>
