 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
There is a
distinction between an object's
|
|
class
and its type
|
|
|
|
– |
Class
defines how an object is implemented
|
|
|
|
– |
Type
defines the object's interface
|
|
|
|
– |
Java thus
defines two forms of inheritance
|
|
|
|
» |
Implementation
inheritance
|
|
|
|
– |
Ex: class B
extends A { m() {} }
|
|
|
|
» |
Interface
inheritance
|
|
|
|
– |
Ex: class C
implements I { m() {} }
|
|