public interface Intf {
int size();
}
public class Cls1 implements Intf {
public int size() {
// implementation 1
}
public class Cls2 implements Intf {
public int size() {
// implementation 2
}
Now, which of the above two implementations will the following method reference refer to ?
Intf::size // note: using Intf
On what basis will the compiler choose between the above two? Or will this method reference throw an exception ?