Convert Integer object to int in Java
Description
The following code shows how to convert Integer object to int.
Example
/*from w w w . j av a 2s .c om*/
public class Main {
public static void main(String[] args) {
int i = 17;
Integer i2 = new Integer(i);
System.out.println(i2.intValue());
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »