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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use polymorphism in oops?

675


What is the benefit of oop?

648


What is multilevel inheritance explain with example?

731


How do you achieve runtime polymorphism?

648


How do you use inheritance in unity?

679






What is advantage of inheritance?

777


IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

1671


How do you define a class in oop?

730


What is meant by oops concept?

686


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

1752


What is the real time example of inheritance?

721


What is abstraction in oop?

725


Which type does string inherit from?

712


What is difference between abstraction and encapsulation?

691


Prepare me a program for the animation of train

2084