Java Long Example Program
Chapter:
Data Types
Last Updated:
15-07-2016 10:01:23 UTC
Program:
/* ............... START ............... */
public class JavaLongExample {
public static void main(String[] args) {
Long obj = new Long(77906);
// returns the value of this Long as a long
long longExample = obj.longValue();
System.out.println("Value of longExample = " + longExample);
}
}
/* ............... END ............... */
Output
Value of longExample = 77906
Notes:
-
The long data type is a 64-bit two's complement integer. The signed long has a minimum value of -263 and a maximum value of 263-1.
- The Long class wraps a value of the primitive type long in an object. An object of type Long contains a single field whose type is long.
Tags
Java Long