ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  What I Hate About Your Programming Language
Subject:   Java: Catch all exceptions?
Date:   2003-05-13 15:27:43
From:   anonymous2
Response to: Java: Catch all exceptions?

I believe if you change "catch" to "care about" you're closer to what the author intends, but you still have to add "non-runtime" in front of exceptions (The compiler doesn't force every method to throw or catch runtime exceptions thrown in child methods).


I circumvent that behavior by declaring (almost) all of my exceptions as runtime.


I don't think Java should require the addition of "throws" to the method declaration for non-runtime exceptions. It should just be implied.


Does anyone have an advantage that forcing the "throws" provides?


1 to 4 of 4
  1. Java: Catch all exceptions?
    2003-05-13 19:30:50  anonymous2 [View]

  2. Java: Catch all exceptions?
    2003-05-13 17:50:15  anonymous2 [View]

  3. Java: Catch all exceptions?
    2003-05-13 17:19:41  anonymous2 [View]

  4. Java: Catch all exceptions?
    2003-05-13 15:44:26  anonymous2 [View]

1 to 4 of 4