Core Java - Interview Questions and Answers for 'Destructor' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Core Java - Interview Questions and Answers for 'Destructor' - 4 question(s) found - Order By Rating

 Q1. In Java, would you like to see an explicit destructor?Core Java
Ans. Yes , a gc method to explicitly call garbage collection immediately on the object. It will provide better flexibility over application that require optimal usage of memory.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     destructor  garbage collection     Asked in 1 Companies      expert


 Q2. Why don't Java objects have destructors ?Core Java
Ans. Java manages memory using built-in garbage collector

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     destructor  garbage collection


 Q3. What are constructors and Destructors in Java ?Core Java
Ans. Constructors are used for initializing the object state once it is initialized and memory has been reserved for it.

Destructor is used to de-allocate memory allocated by objects.

There are no destructors in Java. Alternatively, Java provides Automatic garbage collection i.e automatically releasing the un-referenced memory.


  Sample Code for constructor

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     constructors  destructors     Asked in 2 Companies

Try 1 Question(s) Test


  Q4. What is a Destructor ? Do we have Destructors in Java ?Core Java
Ans. Destructor is used to de-allocate memory allocated by objects.

There are no destructors in Java. Alternatively, Java provides Automatic garbage collection i.e automatically releasing the un-referenced memory.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     destructor  garbage collection     Asked in 11 Companies      Basic        frequent

Try 1 Question(s) Test



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: