The main method tries to access var, but results in ambiguous call. Why? Instance variable var in Base1 isn't accessible (visible?) from static context anyway.
class Base1 {
int var;
}
interface Base2 {
public static final int var = 0;
}
class Test extends Base1 implements Base2 {
public static void main(String args[]) {
System.out.println("var:" + var);
}
}
var
of the interface should be considered because it is static.. – SalamoneTest
class as a whole, regardless of reference to var in the code. On non static context the issue is valid and nonetheless an indication that something was programmed wrong. – Archdeaconry