What is "inheritance"
Inheritance is an object-oriented principle that allows classes to share attributes and methods through "inheritances". It is used in the intention of reusing generalized code or behavior or specializing operations or attributes. The concept of multi-class inheritance is known as multiple inheritance.
As an example you can observe the classes 'student' and 'teacher', where both have attributes such as name, address and telephone. In this case one can create a new class called, for example, 'person', which contains the similarities between the two classes, causing the student and teacher to inherit the characteristics of person, in this way one can say that the student and teacher are subclasses of person.