Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
- /*
- * Convert Integer to primitive int example. Program to convert Java
- * Integer object to primitive int data type.
- */
- public class IntegerToInt {
- public static void main(String args[]){
- //new Integer object
- Integer iObj = new Integer("23");
- //Use intValue method of Integer wrapper to convert it to int
- int i = iObj.intValue();
- System.out.println("Integer converted to int: " + iObj);
- }
- }

Post new comment