What is the purpose of using `finally` block in Java error handling?
The `finally` block is used to define code that should execute only if an exception occurs in the `try` block.
Thatâ€™s partially correct. The `finally` block is always executed, regardless of whether an exception occurs or not.
Can you explain how `finally` differs from `catch` in terms of exception handling?