A major staple of object-oriented programming is the concept of inheritance. Inheritance is when types of data (such as classes) adopt fields – such as variables and methods – from another data type.
Say you have two classes that both share nearly all the same fields, but one has an extra field or an extra method that the other does not have. Coding each one separately is tedious. They behave in the same way for the most part. If you want to change something that both classes have, you need to make the change twice and make sure it’s consistent. It becomes even more of a problem ...