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 abstraction needed?
What is the difference between a constructor and a destructor?
How to use CMutex, CSemaphore in VC++ MFC
What is solid in oops?
What is oops and why we use oops?
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).
What are oops functions?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
is there any choice in opting subjects like 4 out of 7
What is constructor overloading in oop?
what is the sylabus for priliminaries?
What is the difference between abstraction and polymorphism?
Can an interface inherit a class?
What is the oops and benefits of oops programming?
How do you define a class in oop?