Long.valueOf

Long.valueOf

Class Overview | Class Members | This Package | All Packages

Syntax 1
public static Long valueOf( String s, int radix ) throws NumberFormatException
Parameters
s
the String containing the long.
radix
the radix to be used.
Returns
a newly constructed Long initialized to the value represented by the string argument in the specified radix.
Description
Returns a new long object initialized to the value of the specified String. Throws an exception if the String cannot be parsed as a long.

Exceptions
NumberFormatException If the String does not contain a parsable long.



Syntax 2
public static Long valueOf( String s ) throws NumberFormatException
Parameters
s
the string to be parsed.
Returns
a newly constructed Long initialized to the value represented by the string argument.
Description
Returns a new long object initialized to the value of the specified String. Throws an exception if the String cannot be parsed as a long. The radix is assumed to be 10.

Exceptions
NumberFormatException If the String does not contain a parsable long.