[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Double Wrapper?



This is a RuntimeException A method is not required to declare in its throws
clause any subclasses of RuntimeException that might be thrown during the
execution of the method but not caught. 

Nicholas Frank

-----Original Message-----
From: D. Michael Nelson [mailto:nelsondm@attbi.com]
Sent: Wednesday, April 17, 2002 6:00 PM
To: Ajug
Subject: Double Wrapper?
Importance: High



Hello,

The class Double constructor is (public Double(String s) throws
NumberFormatException) declared with NumberFormatException (API docs).  Why
do this particular constructor not required to be enclosed in a try/catch
block?

I was under the impression that if a method is declared to throw an
exception the calling method should provide a try/catch or declare itself to
throw the exception.

Thanks in advance,
D. Michael Nelson.