About 26,600 results
Open links in new tab
  1. Can I catch multiple Java exceptions in the same catch clause?

    If there is a hierarchy of exceptions you can use the base class to catch all subclasses of exceptions. In the degenerate case you can catch all Java exceptions with:

  2. Order of catching exceptions in Java - Stack Overflow

    Jun 10, 2012 · So, when catching exceptions you want to always catch the most specific first and then the most generic (as RuntimeException or Exception). For instance, imagine you would …

  3. java - How can I catch all exceptions thrown through reading / …

    Jul 2, 2009 · In Java, is there any way to get (catch) all exceptions instead of catching the exceptions individually?

  4. Java: catching specific Exceptions - Stack Overflow

    Java: catching specific Exceptions Asked 14 years, 10 months ago Modified 5 years, 7 months ago Viewed 30k times

  5. Why is the Catch (Exception) almost always a bad Idea?

    Mar 10, 2010 · @user316117 Exception is the top class of all exceptions in Java. Catching that means you catch all possible errors. How would you know what to do in such a block? If you …

  6. Catching versus Throwing Exceptions in Java - Stack Overflow

    Jul 4, 2015 · Catching versus Throwing Exceptions in Java [duplicate] Asked 10 years, 1 month ago Modified 6 years, 9 months ago Viewed 14k times

  7. Catching exceptions in Java - Stack Overflow

    Feb 10, 2009 · There are certain predefined exceptions in Java, which, if thrown, report that something serious has happened and you'd better improve your code, than catching them in a …

  8. When is it OK to catch a RuntimeException - Stack Overflow

    Jul 1, 2016 · 1 You catch RuntimeExceptions (in any language: unexpected exceptions/“all” exceptions) when your program is doing multiple subtasks and it makes sense to complete …

  9. java - If catching null pointer exception is not a good practice, is ...

    Jan 17, 2011 · In general, don't catch exceptions, unless you can handle them in some meaningful way. Catch exceptions at process/machine boundaries, log the caught exception …

  10. Preventing exceptions vs. catching exceptions in Java

    Mar 12, 2017 · In Java in particular, certain exceptions descending from RuntimeException (such as IllegalArgumentException) are really meant to signal programming errors, conditions that …