Programming MCQS - QUESTION DETAILS

Which method is called automatically when an object is garbage collected?
A. finalize()
B. dispose()
C. clean()
D. destroy()

'finalize()' is called during garbage collection.

Similar Questions

What is the purpose of the 'instanceof' operator in Java?






How do you open a file for writing in C?






How do you include a header file in C?






What does the 'sizeof' operator return for a pointer variable?






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






How do you close a file in C?






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






Which operator is used to access the value pointed to by a pointer in C?






What is the role of the 'static' keyword in C?






Which keyword is used to prevent method overriding in Java?