Inheritance and Interface in Java

04.02.2008 at 15:23 (JAVA)

Here are some possibilities of how to use and mix inheritances and interfaces in Java.

implements: implements an interface to the class
extends: extends the subclass from the superclass

interface Ione {}
interface Itwo {}
interface Ithree extends Ione {}
interface Ifour extends Ione, Itwo {}
class Cone {}
class Ctwo extends Cone {}
class Cthree implements Ione {}
class Cfour extends Cone implements Ione {}
class Cfive extends Cone implements Ione, Itwo {} 

Einen Kommentar hinterlassen