In this scheme, subclasses specialize the functionality of their parent classes by adding to and customizing the inherited behavior. For example, in The Application Kit, the NSButton class is a subclass of the NSControl class, and thus inherits all properties and functionality of a control as defined in NSControl. Inheritance naturally leads to a large-scale organization of classes that is hierarchical, like the roots of a tree. The Foundation Framework contains the root class of all Cocoa classes. Appropriately, this class is called NSObject, and it defines the basic behavior that makes an object an object.
Inheritance is useful in many ways.
It allows you to reuse code that has been tested and is known to work well, meaning there's less chance of bugs creeping into your code. If you have many classes that implement some common behavior, you can extract that into a superclass from which they all inherit. This makes maintenance easier since updating one class effectively updates the entire tree of subclasses below it. For example, say you have a graphics program that works with circles, squares, and rectangles. As far as the drawing program is concerned, the classes controlling these shapes will share a great deal of code that does not relate to the actual shape we see on screen.