Java – Integer

Java – Integer 2017-08-09T12:52:16+00:00

Java Integer class :

Java 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