Have a look at this code below..
class A {}
abstract class B {}
class Z extends A {
B makeB() { return new B() {}; }
}
public class MultiImplement {
static void takesA(A a) {}
static void takesB(B b) {}
public static void main(
String[] args) {
Z z = new Z();
takesA(z);
takesB(z.makeB());
}
}
With concrete or abstract classes, inner
classes are the only way to produce the effect
of "multiple implementation inheritance ?