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 i oops concept, how many languages supports oops concept?

3 Answers   Value Labs,


What is oops in programming?

1 Answers  


Write pseudo code for push in a stack?

2 Answers   emc2,


difference between static and non-static variables?

2 Answers  


What is the difference between procedural programming and oops?

0 Answers  


What is difference between data abstraction and encapsulation?

0 Answers  


What is ambiguity in inheritance?

0 Answers  


Explain the concept of abstracion and encapsulation with one example. What is the difference between them?

3 Answers   PCS,


What is encapsulation oop?

0 Answers  


What is overriding in oops?

0 Answers  


What is purpose of inheritance?

0 Answers  


How do you define a class in oop?

0 Answers  


Categories