> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Berin Loritsch
> 
> Leo Sutic wrote:
> 
> >>As soon as you declare it, the compiler will require a
> >>try/catch or throws clause--even if it is a RuntimeException.
> > 
> > 
> > No.
> > 
> > public class Hack {
> >     
> >     public void method () {
> >         method2 ();
> >     }
> >     
> >     public void method2 () throws IllegalArgumentException {
> >         throw new IllegalArgumentException ("Yadda");
> >     }
> >     
> >     public static void main (String[] args) {
> >         Hack h = new Hack ();
> >         h.method();
> >     }
> > }
> 
> Really?  I did the exact same thing and got an error during 
> compilation. It must be a stricter IDE specific compiler.  
> I'm not sure that we can count on that continuing to be the 
> case forever though.

No, but they have to change the Java language spec for it to
happen:

http://java.sun.com/docs/books/jls/second_edition/html/exceptions.doc.ht
ml

   "The runtime exception classes (RuntimeException and its 
    subclasses) are exempted from compile-time checking"

/LS

Reply via email to