public interface A {
class Aclass {
int constants = 100;
public void display()
{
System.out.println("Inside A");
}
}
public void display();
}
public interface B {
class Bclass {
int constants = 130;
public void display() {
System.out.println("Inside B");
}
}
public void display();
}
public class MultipleInheritance implements A, B {
@Override
public void display() {
A.Aclass a = new A.Aclass();
System.out.println(a.constants);
B.Bclass b = new B.Bclass();
System.out.println(b.constants);
}
public static void main(String args[]) {
new MultipleInheritance().display();
}
}
though it's through interface and not through a concrete class in context to which you are not inheriting anything but still is it not a code reuse even though maintaining a inner classes will be difficult but still it acts as a multiple-inheritance please clearify with memory representation if possible.