Code with no reuse
Consider the code below.
You would notice that the code in Method Move() is repeated. Duplicate code is a big no no!
Reusing Code by applying Inheritance
In the above code we have reused code by placing it in the parent class. Now what if we have to add a Boat class and a Ship class to this and both of them inherit from the class Vehicles?
But a Boat doesn't have wheels! Instead it needs Turn Rotor in its Move method. Do you see how hard it is to extend the code when we apply inheritance? If we don't apply inheritance at all, we can have extensible code, but then we would also end up with repeating code.
So how do we re use code and make the code extensible at the same time? The answer is programming to an interface.
Program to an Interface