Inheritance is a way to form new classes based on the classes that have already been defined.
For example:
The derived class inherits all the fields and methods of the base class. Note that in the object model, there is no distinction between using system and user-defined types, so you can define sub-types of the system types. This feature is known as extensibility.
In the example abovegetSignature
method
is overridden in the derived class - this is known as polymorphism. The
ability of the object model to execute the correct method based on the type of
a class is called dispatching.