A Wrapper class is a class whose object wraps or contains primitive data types. When we create an object to a wrapper class, it contains a field and in this field, we can store primitive data types. In other words, we can wrap a primitive value into a wrapper class object.
Wrapper class in java provides the mechanism to convert primitive data type into object is called boxing and object into primitive data type is called unboxing.
Since J2SE 5.0, auto boxing and unboxing feature converts primitive data type into object and object into primitive data type automatically. The automatic conversion of primitive data type into object is known as auto-boxing and vice-versa auto-unboxing.
One of the eight classes of java.lang package are known as wrapper class in java. The list of eight wrapper classes are given below:
Primitive Type Wrapper class
boolean Boolean
char Character
byte Byte
short Short
int Integer
long Long
float Float
double Double
Primitive Type Wrapper class boolean Boolean char Character byte Byte short Short int Integer long Long float Float double Double