Multiple choice

A try-finally block is legal and does not require a catch block.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

A try-finally block is completely legal in Java. You do not need a catch block if you have a finally block, which is useful when you want to ensure cleanup code runs regardless of whether an exception is thrown, while letting the exception propagate up the call stack.