Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is virtual destructor? Why?

Answer Posted / sagarika patra

When a destructor is declared as virtual in the base class
is known as virtul destructor.

Whenever any object of derived class of base type is freed
(using delete operator),the destructor of the derived class
is called and the memory allocated by derived class
variables are freed ,leaving the memory allocated by the
base class variables as unfreed.

Hence by declaring the base class destructor as
virtual,both the destructor will called in order.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is data binding in oops?

1096


What is abstraction in oops?

1046


what type of questions

2127


What is coupling in oop?

1026


what's the basic's in dot net

2183


How do you define a class in oop?

1123


How is polymorphism achieved?

1055


Why do we use inheritance?

1118


Can we have inheritance without polymorphism?

1025


Why do while loop is used?

1035


Why do we use polymorphism in oops?

1044


What is class encapsulation?

1095


Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

4147


What is protected in oop?

1072


What is the difference between a mixin and inheritance?

988