public interface foo {
public int g();
}
public class bar implements foo {
public String g() {
return "a string";
}
}
class A {
}
class A_Extension1 category of A {
// all instances of A now have this method
public int foo() {
return 4;
}
}
class A_Extension2 category of A {
// we already declared this, but Objective C lets that slide
public String foo() {
return "a string";
}
}
A a = new A();
a.foo(); // which method gets called?