I read somewhere that Garbage collection is not like destruction(in the C++ sense). how they are different?
I read somewhere that Garbage collection is not like destruction(in the C++ sense). how
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
C++ destruction is deterministic, garbage collection is not.
In C++ you can guarantee when destructors will be called, in Java there is no such guarantee at all. In fact, your destructors might never be called in Java.