Difference between Composition and Aggregation
Answer Posted / benjamin jacob
Composition : Defines a strong-coupled relationship between
two entities, where the one entity is part of another, and
both need each other for their existence. e.g. Human body
and the Heart.
Aggregation : Defines a weak-coupled relationship between
two entities, where one entity could be part of another, but
either can exist without the other, independantly. e.g.
School and teacher.
| Is This Answer Correct ? | 85 Yes | 5 No |
Post New Answer View All Answers
What are the access modifiers?
What is difference between static and non-static fields of a class?
What is the difference between a class and a structure?
Explain the term constructor
Is @functionalinterface annotation mandatory to define a functional interface? What is the use of @functionalinterface annotation? Why do we need functional interfaces in java?
Can an interface have an inner class?
What are the different principle of OOPS?
Does java support multiple inheritance? if not, what is the solution?
What is the default access modifier in a class?
What are the main features of oops?
What are virtual functions, base class pointer, derived class pointer, biding references?
What is the use if instanceof keyword? And how do refer to a current instance of object?
Can a class in java be inherited from more than one class?
How a program can be structured using the concept of object oriented programming?
Name some languages which have object oriented language and characteristics?