You are here: Home / Topics / Program to explain Auto-Boxing and Auto-Unboxing in Java

Program to explain Auto-Boxing and Auto-Unboxing in Java

Filed under: Java on 2023-09-19 08:07:49

// Program to explain Auto-Boxing and Auto-Unboxing.

class Wrapper2
{
public static void main( String args[ ] )
{
 // Autoboxing
 Integer iOb = 100;  

 // Auto-unboxing
 int i = iOb;  

 System.out.println(i + " : " + iOb); 
}
}


Output:

100 : 100

About Author:
M
Mr. Dubey     View Profile
Founder and CEO of MCQ Buddy. I just like to help others.