Why is it so that we can have virtual constructors but we
cannot have virtual destructors?
Answer Posted / 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 |
Post New Answer View All Answers
Can you inherit a private class?
How do you explain polymorphism?
What is object in oops?
What is the point of polymorphism?
what type of question are asked in thoughtworks pair programming round ?
What is meant by multiple inheritance?
What is polymorphism and types?
What are the two different types of polymorphism?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
explain sub-type and sub class? atleast u have differ it into 4 points?
Is react oop?
What is pure oop?
What is the difference between inheritance and polymorphism?
What is new keyword in oops?
What is encapsulation example?