With concrete or abstract classes, inner classes are the only way to produce the effect of multiple implementation inheritance. : Nested Classes « Class Definition « Java Tutorial
class D {
}
abstractclass E {
}
class Z extends D {
E makeE() {
returnnew E() {
};
}
}
publicclass MainClass {
staticvoid takesD(D d) {
}
staticvoid takesE(E e) {
}
publicstaticvoid main(String[] args) {
Z z = new Z();
takesD(z);
takesE(z.makeE());
}
}