Hello,
I'm preparing sjcp 1.4 and I have a doubt with inner classes.
I have readed that an anonymous inner class only can implement one interface, but I can execute this code with success, and I don't understand why if I said before is true.
InterfaceImpl impl = new InterfaceImpl()
{
public void method1()
{
System.out.println("James");
}
};
impl.method1();
interface Interface1
{
public void method1();
}
interface Interface2
{
public void method2();
}
class InterfaceImpl implements Interface1, Interface2
{
public void method1(){System.out.println("metodo1");};
public void method2(){System.out.println("metodo2");};
}
The result is: "James"
Thanks in advance and sorry if I have bad english grammar