Answer Posted / nk
There is nothing like virtual constructors but we can have
virtual destructors so that the destructor of the correct
object is called.
Ex.
Base *bptr = new derived()
delete bptr; then the destructor of the derived objetc is
called when the base destructor is marked as virtual.
else destructore of base class is called and may lead to
memory leak if we have allocated any new memory.
| Is This Answer Correct ? | 18 Yes | 1 No |
Post New Answer View All Answers
What is abstraction in oops?
What does sksksk mean in text slang?
What is polymorphism programming?
Why is oop better than procedural?
What are two types of polymorphism?
What is destructor example?
What is interface? When and where is it used?
What is cohesion in oop?
What do you mean by abstraction?
Why do we use oop?
What is multilevel inheritance in oop?
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 the features of oop?
How do you achieve runtime polymorphism?
how to get the oracle certification? send me the answer