Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

C%20%20%20Interview%20Questions%20and%20Answers

Question: Explain the ISA and HASA class relationships. How would you implement each in a class design?
Answer:
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.
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook