Create Integer object from int in Java
Description
The following code shows how to create Integer object from int.
Example
//from w w w .java2s. c om
public class Main {
public static void main(String args[]) {
Integer iOb = new Integer(100);
int i = iOb.intValue();
System.out.println(i + " " + iOb); // displays 100 100
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »