Composition in Java

Composition in Java is one of the core concepts of object-oriented programming. It is different from the inheritance in Java. Inheritance is defined as Is-A relationship whereas, composition is defined as Has-A relationship. Both composition and inheritance are design techniques…

Read MoreComposition in Java

Aggregation in Java

Aggregation in Java is one of the core concepts of object-oriented programming. It focuses on establishing a Has-A relationship between two classes. Aggregation is a specialized form of unidirectional association that represents a relationship between two class objects where one…

Read MoreAggregation in Java

Association in Java

Realtime Example of Association in Java

Association in Java is a relationship between two separate classes that are independent of one another. It represents a Has-A relationship. Association is one of the core concepts of object-oriented programming in Java. It defines how objects of one class…

Read MoreAssociation in Java