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...

When should you use multiple inheritance?

Answer Posted / neelam saini

There are three acceptable answers:- "Never," "Rarely," and "When the problem domain cannot be accurately modeled any other way."

Consider an Asset class, Building class, Vehicle class, and CompanyCar class. All company cars are vehicles. Some company cars are assets because the organizations own them. Others might be leased. Not all assets are vehicles. Money accounts are assets. Real estate holdings are assets. Some real estate holdings are buildings. Not all buildings are assets. Ad infinitum. When you diagram these relationships, it becomes apparent that multiple inheritance is a likely and intuitive way to model this common problem domain. The applicant should understand, however, that multiple inheritance, like a chainsaw, is a useful tool that has its perils, needs respect, and is best avoided except when nothing else will do.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between interpreters and compilers?

1274


Are php strings immutable?

1110


What is a binary file? List the merits and demerits of the binary file usagein C++.

1370


What are namespaces in c++?

1139


Which is better c++ or java?

1037


Does c++ support multilevel and multiple inheritances?

1060


What is the protected keyword used for?

1168


What is protected inheritance?

1096


Do vectors start at 0?

1046


What is the use of vtable?

1194


In what situations do you have to use initialization list rather than assignment in constructors?

1109


What do you mean by stack unwinding in c++?

1290


What are the differences between new and malloc?

1202


What are the basic data types used in c++?

1079


Why we use #include conio h in c++?

1103