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.