Why is there no destructor in Java?

No, java does not support destructors . All freeing the memory task is done by GARBAGE COLLECTOR. Java has it’s own memory management feature using garbage collector. When you use finalize() the object becomes available for garbage collection and you don’t need to explicitly call for the destructor.

Sizin İçin Seçtik  What is the project of Android?

Leave a Reply

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