|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Integer
public final class Integer
The Integer
class provides several methods for converting an
int
to a String
and a String
to an int
, as well as other constants and methods
useful when dealing with an int
.
Field Summary | |
---|---|
static int |
MAX_VALUE
A constant holding the maximum value an int can
have, 231-1. |
static int |
MIN_VALUE
A constant holding the minimum value an int can
have, -231. |
Constructor Summary | |
---|---|
Integer()
|
Method Summary | |
---|---|
static int |
parseInt(String s)
Parses the string argument as a signed decimal integer. |
static String |
toHexString(int i)
Returns a string representation of the integer argument as an unsigned integer in base 16. |
static String |
toString(int i)
Returns a String object representing the
specified integer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notifyAll, toString, wait |
Field Detail |
---|
public static final int MIN_VALUE
int
can
have, -231.
public static final int MAX_VALUE
int
can
have, 231-1.
Constructor Detail |
---|
public Integer()
Method Detail |
---|
public static String toHexString(int i)
The unsigned integer value is the argument plus
#if (CONFIG_VM_BUILD_32BIT==CONSTANT_TRUE)
232
#else
216
#endif
if the argument is negative; otherwise, it is equal to the
argument. This value is converted to a string of ASCII digits
in hexadecimal (base 16) with no extra leading
0
s. If the unsigned magnitude is zero, it is
represented by a single zero character '0'
('\u0030'
); otherwise, the first character of
the representation of the unsigned magnitude will not be the
zero character. The following characters are used as
hexadecimal digits:
These are the characters0123456789abcdef
'\u0030'
through
'\u0039'
and '\u0061'
through
'\u0066'
.
i
- an integer to be converted to a string.
public static String toString(int i)
String
object representing the
specified integer. The argument is converted to signed decimal
representation and returned as a string.
i
- an integer to be converted.
public static int parseInt(String s)
'-'
('\u002D'
) to indicate a negative value.
s
- a String
containing the int
representation to be parsed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |