why constructor cannt be declar virtually?
why destructor cannt be overloaded?
Answer Posted / subhashish sen
Constructor can't be virtual,becoz constructor is an entity
which initializes V-table(V-table contains addrress of all
the virtual functions of class).So if we declare constructor
as virtual the who will intialize V-table for this constructor.
Destructor can not be overloaded simply becoz we cant
provide argument to a destructor and also its going to
release the memory when an object goes out of scope.
| Is This Answer Correct ? | 20 Yes | 0 No |
Post New Answer View All Answers
Why is object oriented programming so hard?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
What is polymorphism and example?
What is interface in oop?
What is the highest level of cohesion?
What is the important feature of inheritance?
What does it mean when someone says I oop?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
why reinterpret cast is considered dangerous?
What is for loop and its syntax?
How long to learn object oriented programming?
Why is abstraction used?
What is protected in oop?
What is object in oop with example?
What is ambiguity in inheritance?