Guess I :- Which exception is thrown to the outer world? Exception of try block or exception of Finally block?
- Exception is thrown inside
tryblock (highlighted in red).
Finallyblock will always execute and exception is also thrown inside finally block.
- The exception thrown from the
finallyblock would be propagated up the call stack, even if the exception thrown from the
tryblock would probably be more relevant to propagate.
Guess 2 : Which exception is thrown now? Exception of try block or exception of Finally block?
Try with resourcesis implemented
FileInputStreamvariable is declared inside the parentheses after the
- An Exception is thrown inside the
- Exception is also thrown inside
- The exception thrown inside the
tryblock is thrown to the outside world instead of exception thrown inside