About 27,000 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. Difference between using Throwable and Exception in a try catch

    If that is true, it means all expected exceptions should be checked exceptions. What if I expect something might fail and is unrecoverable by my application, but I wish to at least throw a …

  6. Is it possible in Java to catch two exceptions in the same catch …

    Jun 26, 2012 · You should avoid catching overly-broad Exceptions, which is what motivated the Java 7 change. Moreover you should never catch things that you are unable to deal with. …

  7. Is it really that bad to catch a general exception?

    The main thing it depends on is where your are catching the exception. In general libraries should be more conservative with catching exceptions whereas at the top level of your program (e.g. …

  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. Why is the Catch (Exception) almost always a bad Idea?

    Mar 10, 2010 · Catching Exception seems like an efficient way to handle multiple possible exceptions. Unfortunately, it traps all exception types, both checked and runtime exceptions, …

  10. Java exception not caught - Stack Overflow

    Why are some exceptions in Java not caught by catch (Exception ex)? This is code is completely failing out with an unhandled exception. (Java Version 1.4). public static void main (String [] …