To convert
Integer
to int
in Java, use the intValue
method.Here's how you do it:
Integer integer = Integer.valueOf(10);
int intValue = integer.intValue();
System.out.println(intValue); // 10