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
What language is oop?
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 the difference between procedural programming and oops?
2. Give the different notations for the class.\
Why do while loop is used?
hi all..i want to know oops concepts clearly can any1 explain??
Can we create object of interface?
Prepare me a program for the animation of train
What is use of overloading?
What is abstraction encapsulation?
write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory
What are two types of polymorphism?
What is polymorphism oop?
What is constructor overloading in oop?
What is destructor give example?