Does it make sense to do "try-finally" without "catch"?

Solution 1:

This is useful if you want the currently executing method to still throw the exception while allowing resources to be cleaned up appropriately. Below is a concrete example of handling the exception from a calling method.

public void yourOtherMethod() {
    try {
        yourMethod();
    } catch (YourException ex) {
        // handle exception
    }
}    

public void yourMethod() throws YourException {
    try {
        db.store(mydata);
    } finally {
        db.cleanup();
    }
}

Solution 2:

It's there because the programmer wanted to make sure that db.cleanup() is called even if the code inside the try block throws an exception. Any exceptions will not be handled by that block, but they'll only be propagated upwards after the finally block is executed. The finally block will also be executed if there was no exception.