✏️ Explanatory Question
False.
The finally block is not always the last code executed before the program ends.
It executes after the try-catch block completes, regardless of whether an exception was thrown or not.
It is mainly used to release resources (like files or database connections) or perform cleanup tasks.
Example:
try {
System.out.println("Inside try block");
}
catch (Exception e) {
System.out.println("Exception caught");
}
finally {
System.out.println("Finally block executed");
}