All Packages Class Hierarchy This Package Previous Next Index
Class java.lang.Integer
java.lang.Object
|
+----java.lang.Number
|
+----java.lang.Integer
-
public final class Integer
-
extends Number
The Integer class wraps a value of the primitive type int in an
object. An object of type Integer contains a single field whose
type is int.
In addition, this 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.
(Removed a bunch of stuff, see java.lang.Integer for
the full documentation page)
-
valueOf
public static Integer valueOf(String s) throws NumberFormatException
-
Returns a new Integer object initialized to the value of the specified
String. Throws an exception if the String cannot be parsed as an int. The
radix is assumed to be 10.
-
Parameters:
-
s - the string to be parsed.
-
Returns:
-
a newly constructed Integer initialized to the value represented
by the string argument.
-
Throws: NumberFormatException
-
if the string does not contain a parsable integer.