What is virtual destructor? Why?

Answer Posted / riya piyush jain

In object-oriented programming, a destructor (sometimes
shortened to dtor) is a method which is automatically
invoked when the object is destroyed. Its main purpose is
to clean up and to free the resources which were acquired
by the object along its life cycle and unlink it from other
objects or resources invalidating any references in the
process. The use of destructors is key to the concept of
Resource Acquisition Is Initialization.

Is This Answer Correct ?    4 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is abstraction encapsulation?

646


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1409


What are the benefits of oop?

598


What is coupling in oops?

587


How oops is better than procedural?

581






write string class as your own class in java without using any built-in function

1965


What are oops functions?

575


What is meant by multiple inheritance?

729


Which language is pure oop?

545


What are oops methods?

560


What is encapsulation selenium?

549


Why is abstraction used?

597


What is constructor in oop?

576


2. Give the different notations for the class.\

1579


How is class defined?

571