Question OOP-CTOR-0026
EasyDoes Java have destructors like C++?
- A.
No; the garbage collector frees unused objects automatically
- B.
Yes, written with ~
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Constructors and Destructors question
Does Java have destructors like C++?
No; the garbage collector frees unused objects automatically
Yes, written with ~
Sign up free to see the answer and a step-by-step explanation.
Only for static classes
Yes, called finalise() and run immediately