Java Integer longValue() Method
The longValue() method is an instance method of Long class under java.lang package. This method returns the value of the specified long object as long equivalent. The longValue() method were inherited from the Number Class.
Following is the declaration of longValue() method:
The longValue() method returns the numeric value represented by this object after conversion to type long.
Java 1.2 and above
Example 1Test it Now
Value is = 121
Enter The Desired Integer Value: 58648 Long Value is: 58648
Example 3Test it Now
Value of l1 as long is: 298689 The Value of l2 as long is: -98723886