Do you need a destructor in Java?

In Java, the garbage collector automatically deletes the unused objects to free up the memory. Developers have no need to mark the objects for deletion, which is error-prone and vulnerable to the memory leak. So it’s sensible Java has no destructors available .

Sizin İçin Seçtik  What is constructor in C++ in simple words?

Leave a Reply

Your email address will not be published. Required fields are marked *