1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
/* Java long Example This Java Example shows how to declare and use Java primitive long variable inside a java class. */ import java.util.*; public class JavaLongExample { public static void main(String[] args) { /* * long is 64 bit signed type and used when int is not large * enough to hold the value. * * Declare long varibale as below * * long <variable name> = <default value>; * * here assigning default value is optional. */ long timeInMilliseconds = new Date().getTime(); System.out.println("Time in milliseconds is : " + timeInMilliseconds); } } /* Output would be Time in milliseconds is : 1226836372234 */ |
Add Comment