[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Double Wrapper?
Because NumberFormatException is extended from RunTimeException and is an
unchecked exception and as such doesn't require one to catch the exception
and is not required to be in the method signature. Look in a reference
document, or maybe the free on-line book Thinking in Java, or Dr. Baldwin
tutorial for more information.
Tim McCauley
Sr. Software Engineer
C-Cor.net
3950 Johns Creek Court
Suite 300
Suwanee, GA 30024
(770)814-0983
-----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.