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

Similar Programs Chapter Last Updated
Java String Example Program Data Types 19-06-2016
Primitive Datatypes In Java Example Data Types 17-06-2016
Enum In Java Example Data Types 28-04-2016
Java Short Example Program Data Types 10-06-2016
Java Int Example Program Data Types 06-07-2016
Int Array In Java Example Program Data Types 09-06-2016
Java Float Program Example Data Types 28-03-2017
Java Double Example Program Data Types 28-03-2017
Java Char Example Program Data Types 28-03-2017
Java Byte Example Program Data Types 28-03-2017
Java Boolean Example Program Data Types 28-03-2017

1