Why aggregation is better than inheritance in Java?

We should use aggregation if part of the interface is not used or has to be changed to avoid an illogical situation. We only need to use inheritance, if we need almost all of the functionality without major changes. And when in doubt, use Aggregation.

Sizin İçin Seçtik  Yeni hat ne kadar Türk Telekom?

Leave a Reply

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