Java – Integer

Java – Integer 2017-06-13T00:57:18+00:00

Integer class :

The Integer class encapsulates an integer value. This class provides following constructors:

Integer(int i)

Integer(String str)

Here, i is a simple int value and str is a String object.

EX :

 

Output :
I1 = 12
Binary Equivalent = 1100
Hexadecimal Equivalent = c
Minimum Value of Integer = -2147483648
Maximum Value of Integer = 2147483647
Byte Value of Integer = 12
Double Value of Integer = 12.0
i1==i2 true
i1.compareTo(i2) = 0
i3 = 17

Prev Next