Chapter 4. Inheritance and Object-Oriented Concepts
Now that we have built our components and looked at creating Bean objects, we can start to delve a little deeper and have a look at some of the core concepts involved in object-oriented programming.
The world of OOP can be laden with jargon, keywords, and concepts, some of which may be obvious. Others may be easily misunderstood or simply confusing.
In this chapter, we will take a look at a few of the key concepts that you may well experience within an object-oriented application, together with code examples to assist with understanding these ideas, starting with the concept of inheritance.
We will also look at the following:
Polymorphism
Composition
Aggregation
What is Inheritance?
Inheritance is one of the primary concepts of object-oriented programming, and is when one object (a child) extends another object (the parent). By extending the parent object, the child object inherits the properties and methods of the parent object.
By using the concept...