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...


Why is it so that we can have virtual constructors but we
cannot have virtual destructors?

Answers were Sorted based on User's Feedback



Why is it so that we can have virtual constructors but we cannot have virtual destructors?..

Answer / rdl

We can have Virtual Destructor. We cannot have virtual
constructor, becoz, if the constructor is virtual, in
polymorphism, there may be a chance for the base class
constructor not to get executed. so the entire class will
not be available.

Is This Answer Correct ?    11 Yes 0 No

Why is it so that we can have virtual constructors but we cannot have virtual destructors?..

Answer / sachinmundhra

vptr gets initialize in constructor. So in that case we
cannot have virtual constructor.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More OOPS Interview Questions

What is protected in oop?

0 Answers  


What is namespace?

15 Answers  


what is difference between objects and function

3 Answers  


Will I be able to get a picture in D drive to the c++ program? If so, help me out?

0 Answers  


difference between class and object

10 Answers   Chandan, IBM, Magic Soft,


difference between overloading and overridding

11 Answers  


How to overload new operator in c++

2 Answers  


How to use CMutex, CSemaphore in VC++ MFC

0 Answers   Persistent, TCS,


What makes a language oop?

0 Answers  


what is oppes

2 Answers  


Can we create object of class with private constructor?

5 Answers  


What does enum stand for?

0 Answers  


Categories