Why do we need composition in Java?

Benefits of using Composition: Composition allows us to reuse the code . In Java, we can use multiple Inheritance by using the composition concept. The Composition provides better test-ability of a class. Composition allows us to easily replace the composed class implementation with a better and improved version.

Sizin İçin Seçtik  What are the differences between composition and aggregation explain with example?

Leave a Reply

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

Why do we need composition in Java?

Benefits of using Composition: Composition allows us to reuse the code . In Java, we can use multiple Inheritance by using the composition concept. The Composition provides better test-ability of a class. Composition allows us to easily replace the composed class implementation with a better and improved version.

Sizin İçin Seçtik  Peugeot 2008 4X4 mu?

Leave a Reply

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