Autoboxing
Converting a primitive value into an object of the corresponding wrapper class is called autoboxing.
Unboxing
Converting an object of a wrapper class to its corresponding primitive value is called unboxing.
Example:
// Java program to illustrate the concept of Autoboxing and Unboxing public class AutoboxingUnboxingDemo { public static void main(String[] args) { // Creating an Integer object with value 25 Integer x = new Integer(25); // Unboxing the object int y = x; // Autoboxing of char Character ch1 = 'A'; // Unboxing of char char ch2 = ch1; System.out.println("Value of x: " + x); System.out.println("Value of y: " + y); System.out.println("Value of ch1: " + ch1); System.out.println("Value of ch2: " + ch2); } }