In c++ there is only virtual destructors, no constructors. Why?
Answer Posted / uma sankar pradhan
constructors are invoked at the time of object creation.
The v-table for virtual function mechanism is not
intialised properly during the constructor invocation.
So constructors cannot be virtual
But,destructors can be virtual.Because the V-table is
properly initialised at the time of object creation.
So the v-table is available for the destructors.
Destructors can be made pure virtual also.But unlike other
member functions,it must be redfined outside the class.
Is This Answer Correct ? | 57 Yes | 22 No |
Post New Answer View All Answers
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
Can bst contain duplicates?
What is abstraction in oops with example?
What is overloading in oops?
What is data binding in oops?
Explain the concepts involved in Object Oriented programming.
What does and I oop and sksksk mean?
can we make game by using c
How to call a non virtual function in the derived class by using base class pointer
class type to basic type conversion
what type of questions
How do you define social class?
What is abstraction in oop with example?
When not to use object oriented programming?
What are the three parts of a simple empty class?