kevinn lee wrote:
why doesnt line 1 one causes a runtime exception while line 2 does?
The answer to "why" is probably lost in the bowels of history -- ie. I doubt if anyone knows. These are merely two different implementations. The Float implementation seems more robust, can deal with extra whitespaces, and follows the same definition of floating point as the JLS. However, the Long implementation seems to be less robust, and can only take digits -- no white space, no leading zero for octal, no hexidecimal syntax, etc.
Maybe they were done at different times. Maybe they were done by two different developers. Etc. Your guess would probably be as good as mine.
Henry