public final class Integer extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_VALUE
The largest value of type int.
|
static int |
MIN_VALUE
The smallest value of type int.
|
Constructor and Description |
---|
Integer(int value)
Constructs a newly allocated Integer object that represents the primitive int argument.
|
Modifier and Type | Method and Description |
---|---|
byte |
byteValue()
Returns the value of this Integer as a byte.
|
double |
doubleValue()
Returns the value of this Integer as a double.
|
boolean |
equals(Object obj)
Compares this object to the specified object.
|
float |
floatValue()
Returns the value of this Integer as a float.
|
int |
hashCode()
Returns a hashcode for this Integer.
|
int |
intValue()
Returns the value of this Integer as an int.
|
long |
longValue()
Returns the value of this Integer as a long.
|
static int |
parseInt(String s)
Parses the string argument as a signed decimal integer.
|
static int |
parseInt(String s,
int radix)
Parses the string argument as a signed integer in the radix specified by the second argument.
|
short |
shortValue()
Returns the value of this Integer as a short.
|
static String |
toBinaryString(int i)
Creates a string representation of the integer argument as an unsigned integer in base
2.
|
static String |
toHexString(int i)
Creates a string representation of the integer argument as an unsigned integer in base
16.
|
static String |
toOctalString(int i)
Creates a string representation of the integer argument as an unsigned integer in base 8.
|
String |
toString()
Returns a String object representing this Integer's value.
|
static String |
toString(int i)
Returns a new String object representing the specified integer.
|
static String |
toString(int i,
int radix)
Creates a string representation of the first argument in the radix specified by the second argument.
|
static Integer |
valueOf(int i)
Returns the object instance of i
|
static Integer |
valueOf(String s)
Returns a new Integer object initialized to the value of the specified String.
|
static Integer |
valueOf(String s,
int radix)
Returns a new Integer object initialized to the value of the specified String.
|
public static final int MAX_VALUE
public static final int MIN_VALUE
public Integer(int value)
public byte byteValue()
public double doubleValue()
public boolean equals(Object obj)
public float floatValue()
public int hashCode()
public int intValue()
public long longValue()
public static int parseInt(String s) throws NumberFormatException
NumberFormatException
public static int parseInt(String s, int radix) throws NumberFormatException
NumberFormatException
public short shortValue()
public static String toBinaryString(int i)
public static String toHexString(int i)
public static String toOctalString(int i)
public String toString()
public static String toString(int i)
public static String toString(int i, int radix)
public static Integer valueOf(String s) throws NumberFormatException
NumberFormatException
public static Integer valueOf(String s, int radix) throws NumberFormatException
NumberFormatException
public static Integer valueOf(int i)
i
- the primitive