in C Plus Plus by
Q:

Explain the ISA and HASA class relationships. How would you implement each?

▼ Show 1 Answer

0 votes
by

“ISA” relationship usually exhibits inheritance as it implies that a class “ISA” specialized version of another class. For Example, An employee ISA person. That means an Employee class is inherited from the Person class.

Contrary to “ISA”, “HASA” relationship depicts that an entity may have another entity as its member or a class has another object embedded inside it.

So taking the same example of an Employee class, the way in which we associate the Salary class with the employee is not by inheriting it but by including or containing the Salary object inside the Employee class. “HASA” relationship is best exhibited by containment or aggregation.

Learn More with Madanswer

Related questions

+2 votes
asked Jun 19, 2019 in C Plus Plus by johncina
+1 vote
...