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

Precompilation ?

1 Answers   emc2,


Program to open a file with First argument

1 Answers   TCS,


What do you mean by inheritance?

0 Answers   IBS,


In c++ there is only virtual destructors, no constructors. Why?

4 Answers   IBM, Polaris,


What is oop in simple words?

1 Answers  


When is it necessary to use member-wise initialization list in C++?

2 Answers   Adobe,


Write a program to get the binary tree.

3 Answers   ABC,


When is a memory allocated to a class?

11 Answers  


char* ptr = "Rahul"; *ptr++; printf("%s",ptr); What will be the output

9 Answers   Persistent,


why we call c++ is object oriented lanaguage

7 Answers   HCL,


What is the Advantage of Interface over the Inheritance in OOPS?

4 Answers  


write a program that takes input in digits and display the result in words from 1 to 1000

0 Answers   Wipro,


Categories