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 function?

Answer Posted / varun sir

a virtual function is used to avoid duplicacy in derived
classes. suppose that there is a base class which has two
properties a and b. now suppose that two derived classes
named 'der1' and 'der2' are deriving from that base class,
then both properties a and b of base class will be
inherited to both of the derived classes. now if a new
class is derived from 'der1' and 'der2' then both of the
properties a and b of 'der1' and 'der2' will also be
inherited into newly derived class. this will cause
duplicacy in newly obtained derived class. so in order to
avoid this duplicacy , we use virtual functions.

Is This Answer Correct ?    8 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is protected in oop?

1079


What is abstraction and encapsulation?

1022


What is difference between inheritance and polymorphism?

1029


What is encapsulation with example?

1113


Why multiple inheritance is not possible?

1074


How do you answer polymorphism?

1063


State what is encapsulation and friend function?

1269


Why is polymorphism used?

1041


How to use CMutex, CSemaphore in VC++ MFC

4786


How oops is better than procedural?

1101


What is the benefit of oop?

1058


Why is oop better than procedural?

1084


any one please tell me the purpose of operator overloading

2401


What are two types of polymorphism?

1077


Why do pointers exist?

1100