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:
S
Shyam Dubey     View Profile
If you are good in any field. Just share your knowledge with others.