Next: Constructor of a derived
Up: Unit 08
Previous: Inheritance: example
- All the properties (instance variables and methods) defined for the base
class are implicitly defined also for the derived class, i.e., they are
inherited by the derived class.
- The derived class can have additional properties with respect to those
inherited from the base class.
- Each instance of the derived class is also an instance of the base class.
Hence, it is possible to use an object of the derived class in each situation
in which it is possible to use an object of the base class.
- Note that the converse is not true, i.e., it is not possible to
use an object of the base class in each situation in which it is possible to
use an object of the derived class (see later).
Next: Constructor of a derived
Up: Unit 08
Previous: Inheritance: example