Your idea about setting a variable outside the scope of the try/catch/finally is correct.
There cannot be more than one exception propagating at once.
More Related Contents:
- I am learning Java and I have some kinds of error"Exception in thread"
- try/catch with InputMismatchException creates infinite loop
- Text wrap in JOptionPane?
- UnsupportedOperationException when trying to remove from the list returned by Array.asList
- java.sql.SQLException: Access denied for user ‘root’@’localhost’ (using password: YES)
- How to read and understand the java stack trace? [duplicate]
- How to define custom exception class in Java, the easiest way?
- How to fix java.net.SocketException: Broken pipe?
- In Java, when should I create a checked exception, and when should it be a runtime exception? [duplicate]
- Why doesn’t Java allow generic subclasses of Throwable?
- How do you assert that a certain exception is thrown in JUnit tests?
- How do I increase the number of displayed lines of a Java stack trace dump?
- Handling Java crypto exceptions
- JDBC driver throws “ResultSet Closed” exception on empty ResultSet
- What is difference between Errors and Exceptions? [duplicate]
- java.net.MalformedURLException: no protocol
- org.hibernate.MappingException: Unknown entity: annotations.Users
- How can I throw a general exception in Java?
- PKIX path building failed in Java application
- javax.crypto.BadPaddingException
- How can I detect when an Exception’s been thrown globally in Java?
- Exception without stack trace in Java
- String index out of bounds exception java
- Why does TreeSet throw a ClassCastException?
- Java InputMismatchException
- Is there anything like .NET’s NotImplementedException in Java?
- JUnit: Possible to ‘expect’ a wrapped exception?
- Java NoSuchAlgorithmException – SunJSSE, sun.security.ssl.SSLContextImpl$DefaultSSLContext
- How do I write the exception from printStackTrace() into a text file in Java?
- How to restart thread in java? [duplicate]