Long Datatype in Java

Long:
long is 64 bit signed type and used when int is not large enough to hold the value.

Syntax:
Declare long varibale as below
long <variable name> = <default value>;

Note:
here assigning default value is optional.

import java.util.*;
 
public class Long {
 
        public static void main(String[] args) {
                long timeInMilliseconds = new Date().getTime();
                System.out.println("Time in milliseconds is : " + timeInMilliseconds);           
        }
}


Output :
Time in milliseconds is : 1226836372234