[2215] in java-interest
Re: throws declataration in Java/beta
daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Wed Sep 27 02:19:09 1995
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
To: daemon@java.Eng.Sun.COM (Gary Aitken)
Date: Tue, 26 Sep 1995 21:27:49 -0800 (PDT)
Cc: java-interest@webrunner.neato.org (java)
In-Reply-To: <9509270509.AA21005@ montana.com> from "Gary Aitken" at Sep 26, 95 10:09:47 pm
Hi Gary,
> >It is very important to realize that a Java class is a guaranteed interface.
> >If an method is declared to throw a certain set of exceptions than there is no
> >way a sub class can change that. At first this may seem restrictive, but after
> >a while you will realize that it is wonderful to have this guarantee.
>
> It's not clear to me what's so wonderful about this guarantee.
> There is no similar guarantee that a subclass will not compromise the intended
> behavior of its base in numerous other ways. What makes exceptions special?
Exceptions affect the control flow of the caller. While implementing
this feature we found a number of bugs in HotJava were we simply didn't
realize that a certain exception could thrown.
Have fun,
Arthur van Hoff (avh@eng.sun.com)
http://java.sun.com/people/avh/
Sun Microsystems Inc, M/S UPAL02-301,
100 Hamilton Avenue, Palo Alto CA 94301, USA
Tel: +1 415 473 7242, Fax: +1 415 473 7104
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com