Crossfire JXClient, Trunk
|
Classes | |
interface | Animal |
interface | Bird |
interface | Horse |
class | Pegasus |
Static Public Member Functions | |
static void | main (final String[] args) |
This sample diamond interface inheritance with default methods. If there's not already a unique method implementation to inherit, you must provide it. The inheritance diagram is similar to the following:
Animal / \ Horse Bird \ / Pegasus
Both Horse and Bird interfaces implements the go
method. The Pegasus class have to overrides the go
method.
The new syntax of super-call is used here:
<interface_name>.super.<method>(...); For example: Horse.super.go();
So, Pegasus moves like a horse.
Definition at line 54 of file DiamondInheritance.java.
|
static |
Illustrate the behavior of the Pegasus class
args | command line arguments |
Definition at line 142 of file DiamondInheritance.java.