+2 votes
in JAVA by
Define How destructors are defined in Java?

1 Answer

0 votes
by

In Java, there are no destructors defined in the class as there is no need to do so. Java has its own garbage collection mechanism which does the job automatically by destroying the objects when no longer referenced.

Related questions

+2 votes
asked May 31, 2020 in JAVA by SakshiSharma
0 votes
asked Feb 9, 2021 in JAVA by SakshiSharma
...