Dear All, Below is the javadoc comment for parseLong method: 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 '-' (\u002D') to indicate a negative value. The resulting long value is returned, exactly as if the argument and the radix 10 were given as arguments to the parseLong(java.lang.String, int) method. Note that neither the character L ('\u004C') nor l ('\u006C') is permitted to appear at the end of the string as a type indicator, as would be permitted in Java programming language source code.
Thank you Yogesh. Here is what I was investigating: 1. Are type suffixes allowed, optional or prohibited? It is invalid to use the long suffix. It is okay to use the float or double suffix. It is okay to specify a double (2d) in Float.parseFloat It is okay to specify a float (2f) in Double.parseDouble 2. Does �2.0� mean double or does it mean either float or double? It doesn�t matter, because both are acceptable to Float.parseFloat and Double.parseDouble. 3. The API doc for Float.parseFloat refers to Float.valueOf. The API doc for Float.valueOf refers to JLS 3.10.2. JLS 3.10.2 says a float literal must have a suffix. However, if you look at the source code for Float.valueOf, you will see that any of the following: no suffix f F d D is acceptable. [ May 12, 2003: Message edited by: Marlene Miller ]
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop