Why do Double.parseDouble (null) and Integer.parseInt (null) throw different exceptions?
Is it a historical disaster or deliberate? The documentation clearly states two types of exceptions for Double.parseDouble(...) and one for Integer.parseInt() , but this seems inconsistent:
Integer.parseInt(null); // throws java.lang.NumberFormatException: null
However
Double.parseDouble(null);
java nullpointerexception exception numberformatexception
pho79 May 01 '13 at 19:16 2013-05-01 19:16
source share