Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is iterator in c++?

1076


Is c++ harder than java?

1027


How does c++ structure differ from c++ class?

1077


How long does it take to get good at leetcode?

1145


How can you link a c program with a c function?

1044


Write a c program for binary addition of two 8 bit numbers.

4079


If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first a) 1 b) 5 c) 3

1346


Which format specifier is used for printing a pointer value?

1026


Implement stack operations with pointers with appropriate exception checks.

947


Who made c++?

1037


Explain the use of vtable.

1051


What is the protected keyword used for?

1081


Why #include is used?

1033


What are advantages of using friend classes?

1033


What does scope resolution operator do?

1081