This website includes Education Information like a programming language, job interview question, general knowledge.mathematics

Education log

PageNavi Results No.

Ads

Monday, March 6, 2023

what is destructor in java

 what is destructor in java


A destructor in Java is a special method that gets called automatically as soon as the life cycle of an object is finished. A destructor is called to de-allocate and free memory. The following tasks get executed when a destructor is called. Destructors in Java, also known as finalizers are non-deterministic.


What is destructor in Java example?

What is the destructor in Java? It is a special method that automatically gets called when an object is no longer used. When an object completes its life-cycle the garbage collector deletes that object and deallocates or releases the memory occupied by the object.

No comments:

Post a Comment