Friday, February 19, 2010

Interesting Java tidbit

If you pass a number in String form, padded with spaces, like " 89.99 " for example, to Double.parseDouble(), no exceptions will be thrown. If you pass the same number to Integer.parseInt(), a NumberFormatException will be thrown.

No comments: