CONSTRUCTORS AND GARBAGE COLLECTOR IN JAVA (MCQ s & Answers)
1) What is the return type of Constructors? a) int b) float c) void d) None of the mentioned 2)Which keyword is used by method to refer to the object that invoked it? a) import b) catch c) abstract d) this 3)Which of the following is a method having same name as that of its class? a) finalize b) delete c) class d) constructor 4) Which operator is used by Java run time implementations to free the memory of an object when it is no longer needed? a) delete b) free c) new d) None of the mentioned 05) Which function is used to perform some action when the object is to be destroyed? a) finalize() b) delete() c) main() d) None of the mentioned 6.What is the output of this program? 1. class box { 2. int width; 3. int height; 4. int length; 5. int volume; 6. box() { 7. width = 5; 8. height = 5; 9. length = 6; 10. } 11. void vo