What is composition in OOP in Java?

Composition is one of the fundamental concepts in object-oriented programming. It describes a class that references one or more objects of other classes in instance variables . This allows you to model a has-a association between objects. You can find such relationships quite regularly in the real world.

Sizin İçin Seçtik  What is inheritance how it is implemented explain with example?

Leave a Reply

Your email address will not be published. Required fields are marked *