Do interfaces solve the “deadly diamond of death” issue?
问题 Do interfaces solve the deadly diamond of death problem? I don't think so, for example: // A class implementing two interfaces Interface1 and Interface2. // Interface1 has int x=10 and Interface2 has int x = 20 public class MultipleInterface implements Interface1, Interface2{ public void getX(){ System.out.println(x); } } Here we get an ambiguous x . Though interfaces are a good way for solving method ambiguity, I guess they fail in the case of variables? Am I correct? If I am missing