Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is virtual constructors/destructors?

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


Please Help Members By Posting Answers For Below Questions

What is abstraction in oops?

1042


What does sksksk mean in text slang?

2115


What is polymorphism programming?

1126


Why is oop better than procedural?

1076


What are two types of polymorphism?

1072


What is destructor example?

1041


What is interface? When and where is it used?

2165


What is cohesion in oop?

1053


What do you mean by abstraction?

1068


Why do we use oop?

1097


What is multilevel inheritance in oop?

1033


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

3222


What are the features of oop?

1172


How do you achieve runtime polymorphism?

1047


how to get the oracle certification? send me the answer

2155