C and C++ has constructors and distructors, why does Java
does not have distructors?

Answer Posted / sandesh magdum

Because java has automatic garbage collection feature and java
does not let you illegally or accidentally release memory
occupied by an object.

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are instance variables?

863


Is node a data type in java?

766


How many types of java are there?

783


Explain when we should make an instance variable private.

843


Explain the public class modifier?

744


What is treeset in java?

786


What is the purpose of extern variable?

788


If two threads have same priority which thread will be executed first ?

1182


we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.

1838


What are the advantages and disadvantages of reference counting in garbage collection?

823


What is the syntax and characteristics of a lambda expression?

834


What occurs when an object is constructed?

802


What are computer functions?

734


Can we convert integer to string in java?

855


What is final variable?

723