Inheritance is one of the keys to OO programming. It lets classes share code and have a common interface and type, allowing generic code to be written using only the interface and not worrying about the implementation, which can change dynamically. The classic example is shapes. A square and a circle are both shapes and can be drawn. The way in which it is drawn is of no concern to users who just want to draw some collection of shapes, they can just use the shape draw operation and not worry.