Inheritance Inheritance Inheritance captures the idea that certain classes of objects are related to each other in useful ways. For example, inheritance is widely used in windowing systems. This way, the code to repaint the entire screen can simply call the Repaint function on every object on the screen. The code that calls Repaint doesn't need to know which kinds of objects are on the screen, as long as each implements Repaint . You can share pieces of an implementation between two objects.
Inheritance provides a way to re-use code between nearly similar classes.