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
Does there exist any other function which can be used to convert an integer or a float to a string?
What are the four main data types?
What language is a dll written in?
What is setw manipulator in c++?
What is expression parser in c++
What is struct c++?
Explain method of creating object in C++ ?
Which format specifier is used for printing a pointer value?
Define pointers?
what do you mean by volatile variable?
How one would use switch in a program?
What is the difference between passing by reference and passing a reference?
What do you mean by static variables?
Differentiate between declaration and definition.
What are the restrictions apply to constructors and destructors?