what is virtual destructor

Answer Posted / isha

Dear friend , you have done a mistake..
Example:

class Employee {
virtual ~Employee() {}
};

class Manager : public Employee {
~Manager() {}
}

Employee * m = new Manager();//here was the mistake
delete m; // <--

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we override main method?

609


what is different between oops and c++

2004


What is destructor in oop?

627


What is oops and its features?

592


What are the two different types of polymorphism?

674






What is polymorphism used for?

577


Why is object oriented programming so hard?

616


What is difference between data abstraction and encapsulation?

620


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

1545


What are the three parts of a simple empty class?

1462


What are oops functions?

587


What is encapsulation in ict?

608


Why is polymorphism used?

588


What is difference between pop and oop?

609


Advantage and disadvantage of routing in telecom sector

790