What is virtual destructor? Why?
Answers were Sorted based on User's Feedback
Answer / sagarika patra
When a destructor is declared as virtual in the base class
is known as virtul destructor.
Whenever any object of derived class of base type is freed
(using delete operator),the destructor of the derived class
is called and the memory allocated by derived class
variables are freed ,leaving the memory allocated by the
base class variables as unfreed.
Hence by declaring the base class destructor as
virtual,both the destructor will called in order.
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / mugdha taru
virtual destructor are those who can not override while
redefining derived class.
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / riya piyush jain
In object-oriented programming, a destructor (sometimes
shortened to dtor) is a method which is automatically
invoked when the object is destroyed. Its main purpose is
to clean up and to free the resources which were acquired
by the object along its life cycle and unlink it from other
objects or resources invalidating any references in the
process. The use of destructors is key to the concept of
Resource Acquisition Is Initialization.
| Is This Answer Correct ? | 4 Yes | 8 No |
What is Inheritance, Multiple Inheritance, Shared and Repeatable Inheritance?
What are the 4 main oop principles?
What is class encapsulation?
i ahve v low % in 12th n BSC which is aroun 50 coz science was imposed on me......nw m doin MCA n my aggregate in above 74%,what shud i say if asked about low previous percentage??????
what is diff between .net 1.1 and .net 2.0
What is a linked list?
What is polymorphism and example?
Whatis the difference between oop and object based language
what are three tenets of object orinted Systems?Why they call like that ? Please answer me. Advance thanks.
When is an object created and what is its lifetime?
Round up a Decimal number in c++.. example Note = 3.5 is as 4 3.3 is as 3
3 Answers Accenture, Cognizant, IBM,
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)