Explain the ISA and HASA class relationships. How would you
implement each in a class design?
Answer Posted / neelkamal yadav
A specialized class "is" a specialization of another class and, therefore, has the ISA relationship with the other class. An Employee ISA Person. This relationship is best implemented with inheritance. Employee is derived from Person. A class may have an instance of another class. For example, an employee "has" a salary, therefore the Employee class has the HASA relationship with the Salary class. This relationship is best implemented by embedding an object of the Salary class in the Employee class.
The answer to this question reveals whether the applicant has an understanding of the fundamentals of object- oriented design, which is important to reliable class design.
There are other relationships. The USESA relationship is when one class uses the services of another. The Employee class uses an object (cout) of the ostream class to display the employee's name on the screen, for example. But if the applicant gets ISA and HASA right, you don't need to go any further.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300â€Â,â€ÂBullCart : 10â€Â) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side
What is near, far and huge pointers? How many bytes are occupied by them?
What are c++ data types?
Why can templates only be implemented in the header file?
How the programmer of a class should decide whether to declare member function or a friend function?
What is data abstraction? How is it different from data encapsulation?
What is & in c++ function?
What is the difference between a template and a macro?
How would you use the functions randomize() and random()?
Is c++ a dying language?
True or false, if you keep incrementing a variable, it will become negative a) True b) False c) It depends
What are enumerations?
What is data type in c++?
How do you invoke a base member function from a derived class in which you’ve overridden that function?
What is the advantage of an external iterator.