What is the difference between inheritance and aggregation in Java?

With aggregation we create a new class, which is composed of existing classes. With inheritance we create a new class, which is based on existing class, with some modifications . subclasses. In the Java language, classes can be derived( רזגנ (from other classes, thereby inheriting fields and methods from those classes.

Sizin İçin Seçtik  What is composition in oops?

Leave a Reply

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