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
Describe public access specifiers?
Is c++ low level?
Do class method definitions?
Explain the difference between class and struct in c++?
What is a character in c++?
What are static variables?
Is java the same as c++?
What is basic if statement syntax?
Explain pass by value and pass by reference.
Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?
Define stacks. Provide an example where they are useful.
How does list r; differs from list r();?
Do the parentheses after the type name make a difference with new?
What are the advantages of prototyping?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);