Object-oriented languages can be divided into two categories based on whether or not they place all objects into the same inheritance hierarchy. Some languages, such as Smalltalk and Java, insist that every class have a parent class. This naturally means that all classes fit into one large hierarchy. Other languages, such as C++, only use inheritance when the programmer explicitly calls for it. This means that the typical object program will have many small hierarnchies, unrelated to each other.
One advantage of the first technique is that it is possible to declare a variable that can hold any object type. (Namely, in a variable of the type defined by the root of the inheritance hierarchy). This is not possible in the second technique.