GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 21 of 258    Print  
Explain the need for "Virtual Destructor".

  
Total Answers and Comments: 1 Last Update: August 30, 2005   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 30, 2005 05:30:43   #1  
Ruth Samuel        

RE: Explain the need for "Virtual Destructor".
When classes are inherited we need to make the base class destructor virtual to make sure when the object is destroyed all the derived class destructors also called. Otherwise the derived class destructors are not called because the there is compile time binding of the destructor pointer to the base class destructor.


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : When classes are inherited, we need to make the base class destructor virtual – to make sure when the object is destroyed, all the derived class destructors also called. Otherwise the derived class destructors are not called because the there is compile ...

Explain "passing by value", "passing by pointer" and "passing by reference"
Tags : Pointer

Latest Answer : The return type of the printf() function is 'int'. (lot of confusion surrounding the return type of printf -- correct answer is 'int')  ...

Latest Answer :  there is no way to process an entire string.it has to be done char by char ...

Latest Answer : Polymorphism is the ability to assume many forms. In short it refers to several methods / operators sharing the same name but having different parameter list and different implementations. Variables also can be polymorphic. There are two ways polymorphism ...

Latest Answer : /*without virtaul*/#include #includeusing namespace std;class Base{       public:          void fun()          ...

Can we call constructor of superclass directly without using super()method in subclass? if yes,explain,if no,why?

Latest Answer : Abstraction is just like a Hotel room where a single person wants only 1bed+bathroom but family required minimum of double bed +bathroom. Whereas few people want AC system or hot water system or TV like accessories but other don’t. During the ...
Read Answers (6) | Asked by : Nagasree V

Latest Answer : desturctor is to destory objects.this is denoted by '~'.for eg:class  alpha{public:read(int);disp();~alpha();};void alpha::read(){couti;}void alpha::~alpha(int i){i--;cout
Read Answers (2) | Asked by : muthu

Latest Answer : OOPs is Object Oriented Programming.The great thing about OOPs is that is all about classes and objects which can easily correlated with real life scenarios.Class is the general thing and object is the specilisation of general thingFor example if ...
Read Answers (1) | Asked by : kalps
Tags : OOPS


 Sponsored Links

 
Related Articles

OOPS Tutorials

Object oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1960’ s The term object oriented programming’ was originally coined by Xerox PARC to designate a computer application that describes the methodol
 

The Inheritance Concept In OOPs

The Inheritance Concept In OOPs In object oriented programming objects will be characterised by classes It is possible to learn a lot about an object based on the class it belongs to Even if you are not familiar with the name Maybach If I told you it is a car you would immediately know that it has f
 

Understanding The Message Concept In OOPs

Understanding The Message Concept In OOPs To understand object oriented programming you will need to become familiar with messages As the name implies a message is a process in which software objects will communicate with one another Because of this having one object is not enough mosgoogle An objec
 

Basic concepts of OOPS and Structure of C++ program

Basic concepts of OOPS and Structure of C program In this tutorial you will learn about Objects Classes Inheritance Data Abstraction Data Encapsulation Polymorphism Overloading Reusability Before starting to learn C it is essential that one must have a basic knowledge of the concepts of Object orie
 

Be Prepared for Tech Job Cuts

Even one of the most flourishing and possibly the strongest industries of the future are not experiencing the economic crunch. The tech industry is now experiencing massive job losses in different categories. Although you will still see innovations almost every day from the tech industry through th
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape