|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
• |
Defines a IS-A relationship between classes.
|
|
• |
Base classes and derived classes.
|
|
• |
Derived class inherits all fields and
methods of base class.
|
|
• |
Derived class objects are type compatible
with base class.
|
|
• |
protected fields and methods: visible to derived classes and to
|
classes in same package.
|
|
• |
inheritance is transitive.
|
|
• |
polymorphism allows for redefining fields and methods.
|
|
• |
dynamic binding allows for run-time determination
of
|
|
overloads and/or overrides.
|
|
• |
super() is a way to refer to constructor of base class.
|
|
It can also be called using appropriate parameters.
|
|
It can only be the first line of a
constructor.
|
|
• |
super with appropriate parameters is also used to
|
|
invoke the corresponding method of the
base class.
|
|