Java provides wrapper classes for all eight primitive types. These classes encapsulate a primitive value in an object.
Source Code
Integer myInt = 5; // Autoboxing of int to Integer
int myPrimitiveInt = myInt; // Unboxing of Integer to int
Use wrapper classes when you need to store primitive values in collections like ArrayList, or to utilize methods provided by these classes.