Long.parseLong

Long.parseLong

Class Overview | Class Members | This Package | All Packages

Syntax 1
public static long parseLong( String s, int radix ) throws NumberFormatException
Parameters
s
the String containing the long.
radix
the radix to be used.
Returns
the long represented by the string argument in the specified radix.
Description
Parses the string argument as a signed long in the radix specified by the second argument. The characters in the string must all be digits of the specified radix (as determined by whether Character.digit returns a nonnegative value), except that the first character may be an ASCII minus sign '-' to indicate a negative value. The resulting long value is returned.

Exceptions
NumberFormatException if the string does not contain a parsable integer.



Syntax 2
public static long parseLong( String s ) throws NumberFormatException
Parameters
s
a string.
Returns
the long represented by the argument in decimal.
Description
Parses the string argument as a signed decimal long. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' to indicate a negative value.

Exceptions
NumberFormatException if the string does not contain a parsable long.