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
Write a program to sort the number with different sorts in one program ??
What is the difference between encapsulation and polymorphism?
Explain the concepts involved in Object Oriented programming.
• What are the desirable attributes for memory managment?
Why is polymorphism needed?
Prepare me a program for the animation of train
What is the types of inheritance?
what are the ways in which a constructors can be called?
What is pure oop?
What are the three parts of a simple empty class?
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
What is object in oops?
How do you achieve polymorphism?
What is class and object in oops?
What is coupling in oops?