Programming MCQS - QUESTION DETAILS

What is the purpose of the 'finally' block in Java?
A. Define exceptions
B. Throw exceptions
C. Catch exceptions
D. Cleanup code

'finally' is used for cleanup code that always executes, whether an exception occurs or not.

Similar Questions

In C, how do you declare a constant?






What is the output of System.out.println(Math.floor(7.8));?






How do you declare an array in Java?






What is the output of printf("%d", 5 + 3 * 2);?






What is the format specifier for printing a float in C?






What is the purpose of the 'typedef' keyword in C?






What is the purpose of the 'break' statement in a loop in Java?






What is the purpose of the 'finally' block in Java?






How is an abstract class different from an interface in Java?






What is the output of System.out.println("Hello" + 1 + 2);?