What’s difference between Association, Aggregation and
Inheritance relationships?

Answers were Sorted based on User's Feedback



What’s difference between Association, Aggregation and Inheritance relationships?..

Answer / purusoth

Class hierarchies (Inheritance and aggregation)

What is difference between Association, Aggregation and
Inheritance relationships?

In object oriented world objects have relation and
hierarchies in between them. There are
basically three kind of relationship in Object Oriented
world :-

Association
This is the simplest relationship between objects. Example
every customer has sales. So
Customer object and sales object have an association
relation between them.

Aggregation
This is also called as composition model. Example in order
to make a “Accounts” class it
has use other objects example “Voucher”, “Journal”
and “Cash” objects. So accounts
class is aggregation of these three objects.

Inheritance
Hierarchy is used to define more specialized classes based
on a preexisting generalized
class. Example we have VEHICLE class and we can inherit
this class make more
specialized class like CAR, which will add new attributes
and use some existing qualities
of the parent class. Its shows more of a parent-child
relationship. This kind of hierarchy
is called inheritance.

Is This Answer Correct ?    26 Yes 4 No

What’s difference between Association, Aggregation and Inheritance relationships?..

Answer / meenakshi sharma

Association- Association is used for establishing
relationship between classes. Association describes links
between(among) classes. For example, if a professor works
in a university then it can be represent as the assciation
relationship between professor and university class.

Aggregation-Aggregation is a concept that is used to
express "part-of" types of associations between
objects.Aggregation is seen as a relationship in which an
assembly class is related to component class. In this
component objects are not having seperate existence, they
depend on composite objects.

Inheritance-Inheritance is an object orientation concept
which allow reusability of design/code. Basic meaning of
inheritance is that if one class is already defined than
another class which also passes the property of existing
class can be defined and inherit the property of existing
class. For example, if a class named Student is defined and
another class for Post Graduate students is to be defined
then PG Student class can inherit the Student class.

Is This Answer Correct ?    13 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Why do we use Design Pattern in C#?

0 Answers   Impetus,


Can you override private virtual methods?

4 Answers  


what is serilization?

6 Answers   Protech,


What is hierarchical inheritance in c#?

0 Answers  


Explain About .Net remoting

0 Answers   Digital GlobalSoft,






What is an event in c#?

0 Answers  


code for arranging given number in possible permutation ways ex:123,321,312,132,231,213.

0 Answers  


Explain the difference between a namespace and assembly name in .net?

0 Answers  


Is there hashmap in c#?

0 Answers  


What are the types of constructors?

0 Answers  


What is the name of c# compiler?

0 Answers  


Explain the difference between access specifier and access modifier in c#?

0 Answers  


Categories