How to convert primitive int to Integer object in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {

        int i = 13;

        Integer iObj = i;
        System.out.println(iObj);
    }
}
   
/*
      
run:
      
13
  
*/

 



answered Nov 7, 2016 by avibootz
...