Think of our BankAccount as an example. For example, there is no interest. Let us create such a class then. Then we start sketch a class with exactly the same methods and variables, but we see that we only added two methods to compute the interest and set the rate of interest, further one variable holding the rate of interest. Here inheritance comes to play.
Inheritance is simply to add more specified properties to an old class, as the illustration shows.
And we are done. Interesting points are that we now can choose whether we like to use the basic account or the account with an interest as we like to. Still, do not use parentheses if not needed since that may cause the compiler not to find the most efficient algorithm. Beyond that we can have other sub classes, in parallel with InterestAccount or derived from that class etcetera. But we cannot inherit from more than one class at a time, which encourages us to design well and to think more than twice.