Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: interface Inheriting multiple interfaces
|
Posted: Oct 16, 2004 4:37 PM
|
|
I can never understand why people go to all the work to post such questions and wait for answers on in a forum, when the question can be answered much more simply, quickly and authoritatively by the compiler.
interface A { void a(); }
interface B { void b(); }
interface C { void c(); }
public class MultipleInterfaces implements A,B,C
{
public void a() { System.out.println("Ay!"); }
public void b() { System.out.println("Bzzzz"); }
public void c() { System.out.println("See?"); }
public static A gimmeAnA()
{
return new MultipleInterfaces();
}
public static B gimmeAB()
{
return new MultipleInterfaces();
}
public static C gimmeAC()
{
return new MultipleInterfaces();
}
public static void main(String [] args)
{
A a = gimmeAnA();
B b = gimmeAB();
C c = gimmeAC();
a.a();
b.b();
c.c();
}
}
Of course, just about any introduction to Java, whether it be on the net or in a book will state the fact, as well.
|
|