Java – Long

Java – Long 2017-06-13T00:59:02+00:00

Long :

The Long class encapsulates a long value. It defines the constants MAX_VALUE and MIN_VALUE and provides the following constructors:

Long(long l)

Long(String str)

EX :

 


Output :
Object L1 = 68764
Object L2 = 686748
Minimum Value of Long = -9223372036854775808
Maximum Value of Long = 9223372036854775807
L1 * 2 = 137528
L1.longValue() * 2 = 137528
L1.compareTo(l2) = -1
L1==L2 ? = false
Object L3 = 16
Byte value of Long = -100
int value of Long = 68764
Double value of Long = 68764.0
Binary equivalent of decimal 12=1100
Hexadecimal equivalent of decimal 12=c

Prev Next