Inheritance

Allows classes to be built-upon  rather than re-invented.

 

The derived class can use all fields and methods of the base class, and more.

 

Another viewpoint:

Base class is general,

derived class is specialized.

 

In a certain sense, object of derived class is also  in base class (as well as derived one);

an object can be in >1 class.

 

Also, derived class can redefine  method in base class

 

 

Java jargon

Example seen in testGraphics1.java

 

To Next Slide To Previous Slide To Contents