[1991] in java-interest

home help back first fref pref prev next nref lref last post

throws declataration in Java/beta

daemon@ATHENA.MIT.EDU (Paul Ambrose)
Thu Sep 21 07:08:08 1995

From: "Paul Ambrose" <pambrose@weblogic.com>
To: java-interest@java.Eng.Sun.COM
Date: Wed, 20 Sep 1995 23:17:35 +0000

Can someone please confirm the following:

In beta Java, if object A extends object B, and both implement method
foo(),  A.foo() *cannot* throw exception X unless B.foo() also
throws X.  If you declare that A.foo()  throws X, the compiler
will complain that B doesn't also throw X.

This means that you can NEVER throw an exception from a 
toString() method because Object.toString() doesn't throw
any exceptions.

Is this correct? 

Paul
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post