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

Describe public access specifiers?

1111


Is c++ low level?

1030


Do class method definitions?

1038


Explain the difference between class and struct in c++?

1034


What is a character in c++?

1040


What are static variables?

1133


Is java the same as c++?

986


What is basic if statement syntax?

1080


Explain pass by value and pass by reference.

1053


Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?

1259


Define stacks. Provide an example where they are useful.

1013


How does list r; differs from list r();?

1147


Do the parentheses after the type name make a difference with new?

1081


What are the advantages of prototyping?

1059


Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);

1053