Class hierarchies make construction, debugging and maintenance easier and encourage reuse. Every class in a hierarchy has only one parent class, but a class can have any number of child classes. A child class is an extension of its parent and inherits all of its parent's resources. Abstract classes are only used as the foundation of non-abstract classes. All the classes in a hierarchy should be collected together in a package of classes.
Classes have public, private and protected resources.
Private resources are totally invisible outside the class, protected resources are only visible to child classes and public resources are totally visible. Classes are designed using a class diagram which shows the public resources on the right, the protected resources on the left and may show its private resources in the middle. Classes themselves can be protected or public, only public classes are visible outside the package. A child class can only access the private resources of its parent by using the protected or private actions. A class hierarchy should be constructed in stages by building a class and demonstrating that it seems to work before continuing with the next class in the hierarchy.