Crossfire JXClient, Trunk
Classes | Static Public Member Functions | List of all members
DiamondInheritance Class Reference
Collaboration diagram for DiamondInheritance:
Collaboration graph

Classes

interface  Animal
 
interface  Bird
 
interface  Horse
 
class  Pegasus
 

Static Public Member Functions

static void main (final String[] args)
 

Detailed Description

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.

Member Function Documentation

◆ main()

static void DiamondInheritance.main ( final String[]  args)
static

Illustrate the behavior of the Pegasus class

Parameters
argscommand line arguments

Definition at line 142 of file DiamondInheritance.java.


The documentation for this class was generated from the following file: