Conversion (wrapper class)Integer Number Object to (primitive data type) int

Java Programming Language / OOPs concept more

26612

Program:

public class WrapperclassToPemitiveDataType{

public static void main(String args[]){
	//Converting Integer to int
	Integer n=new Integer(15);
	int i=n.intValue();//converting Integer to int
	int j=n;//unboxing, now compiler will write n.intValue() internally

	System.out.println(n+" "+i+" "+j);
	}
}

Output:

15 15 15
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.