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?
A try statement should have either catch block or finally block, it can have both blocks.
We can’t write any code between try-catch-finally block.
We can’t have catch or finally clause without a try statement.
We can have multiple catch blocks with a single try statement.try-catch blocks can be nested similar to if-else statements.
We can have only one finally block with a try-catch statement.