I am trying to use the finally block without using the try/catch blocks but getting the error in Eclipse.
Can I use the finally block without using the try/catch blocks?
From Oracle Trails:
The finally block always executes when the try block exits. This ensures that the finally block is executed even if an unexpected exception occurs.
From the above statement, you cannot have finally block alone on its own. below are the combinations allowed.
try catch finally
try catch
try finally