Online Java Compiler By
JavaTpoint.com
public class IntegerLongValuetExample3 { public static void main(String[] args) { Long object1 = new Long(298689); // returns the value of this Long object as a long long l1 = object1.longValue(); System.out.println("Value of l1 as long is: " + l1); Long object2 = new Long(-98723886); // It will return the value of this Long as a long long l2 = object2.longValue(); System.out.println("The Value of l2 as long is: " + l2); } }
Output