Name
java.lang.Integer
Synopsis
This class is a smaller counterpart to the J2SE
Integer
class. It provides an object wrapper
around a single int
primitive data type. The class
contains several static methods for converting an
int
to various formats, as well as two
valueOf()
methods to convert a string with an
optionally specified radix back into an Integer
.
To dump the stored character back into a primitive
int
, long
, or
short
data type, use the
intValue()
, longValue()
, or
shortValue()
methods, respectively.
public final classInteger
{ // public constants public static final intMIN_VALUE
; public static final intMAX_VALUE
; // static methods public static intparseInt
(String s, int radix) throws java.lang.NumberFormatException; public static intparseInt
(String s) throws java.lang.NumberFormatException; public static StringtoBinaryString
(int i); public static StringtoHexString
(int i); public static StringtoOctalString
(int i); public static StringtoString
(int i); public static StringtoString
(int i, int radix); public static IntegervalueOf
(String s, int radix) throws java.lang.NumberFormatException; public static IntegervalueOf
(String s) throws java.lang.NumberFormatException; // public constructor publicInteger
(int value); // public instance methods public bytebyteValue
(); public booleanequals
(Object obj); public inthashCode
(); public intintValue
(); public longlongValue
(); public shortshortValue
(); public StringtoString
(); }
Get Wireless Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.