How to convert the value of Integer number object to long primitive data type in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {
 
    public static void main(String[] args) {
        
        Integer i = 31;
        long l;
        
        l = i.longValue(); 

        System.out.println(l);
    }
}
 
/*
run:

31
 
*/

 



answered Sep 6, 2016 by avibootz
...