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
What is the role of static keyword for a class member variable?
Mention the purpose of istream class?
Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?
What is a unnitialised pointer?
What is a literal in c++?
What do the keywords volatile and mean mutable?
Why we use #include conio h in c++?
What is enum class in c++?
Evaulate: 22%5 a) 2 b) 4 c) 0
What is c++ redistributable?
Refer to a name of class or function that is defined within a namespace?
Would you rather wait for quicksort, linear search, or bubble sort on a 200000 element array? (Or go to lunch...) a) Quicksort b) Linear Search c) Bubble Sort
What is a stack c++?
What is the role of C++ shorthand's?
What is flush programming?