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 find 2^n+1 ?
How does polymorphism work?
What is class and object in oops?
What is interface? When and where is it used?
What is oops and why we use oops?
Are polymorphisms mutations?
What is encapsulation in simple terms?
Who invented oop?
What does enum stand for?
any one please tell me the purpose of operator overloading
What is the purpose of enum?
What is a class and object?
What are the types of abstraction?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
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.