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

Answers were Sorted based on User's Feedback



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

Answer / nishikant sahu

"ISA" a relationship is aka Inheritance and used to extent
the capability of Base, whereas "HASA" relationship is aka
Containment use to take the all properties of BASE.

Is This Answer Correct ?    19 Yes 3 No

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

Answer / 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

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

Answer / guest

A specialized class "is" a specialization of another class
and, therefore, has the ISA relationship with the other
class.
This relationship is best implemented by embedding an
object of the Salary class in the Employee class.

Is This Answer Correct ?    9 Yes 13 No

Post New Answer

More C++ General Interview Questions

There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.

0 Answers  


Why for local variables the memory required to hold the variable is allocated from the program stack and for new its allocated from the heap?

1 Answers  


Difference between delete and delete[]?

5 Answers   Infosys, TCS, Virtusa,


How do you initialize a string in c++?

0 Answers  


What is the Maximum Size that an Array can hold?

55 Answers   Adobe, FutureSoft, HCL, Infosys, Satyam, TCS, Wipro,






What is endl c++?

0 Answers  


How do you compile the source code with your compiler?

0 Answers  


Array base access faster or pointer base access is faster?

0 Answers  


Can I learn c++ in a week?

0 Answers  


what are the iterator and generic algorithms.

0 Answers  


What is switch case in c++ syntax?

0 Answers  


Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?

0 Answers  


Categories