You can define the following relationships between two object classes:
Inheritance
between two classes
Extending the functions of a class by implementing interfaces. This is a relationship between classes and interfaces
Compound interfaces
. This is a relationship between interfaces.
Characterization
Inheritance is a relationship between classes. It allows you to derive a new class from the definition of an existing class. The new class is called a subclass, the existing class is its superclass. Inheritance is used to create a subclass that is more specialized than its superclass. You can add new components to a subclass, and also redefine the methods that it inherits. The result of inheritance is a class hierarchy. The Class Builder allows you to create a class hierarchy very simply. You can create a subclass for any class that is not defined as final, and can also define a direct superclass for a class that was itself not derived.
Interfaces allow you to extend a class definition. When a class implements an interface, all of the interface components appear as components of the class. You can access these components either using a class reference or an interface reference. Interfaces allow you to work with several different classes in a uniform way. The actual implementation of the interface components takes place in the classes. Consequently, interfaces provide a way of separating the definition and implementation of components.
Interfaces can contain attributes, methods, and events, but also other interfaces. Classes that implement a compound interface must also implement all of its components. Compound interfaces are a specialization of their component interfaces.
Features
Creating subclasses
Redefining inherited methods
Creating superclasses
Assigning interfaces to classes
Defining and implementing interface methods within a class definition