what will happen if fields with same name inherites from two sources(class and interface)
问题 valid code: interface Int1{ String str = "123"; } class Pparent{ String str = "123"; } class F extends Pparent implements Int1{ } invalid code add main method to F class: class F extends Pparent implements Int1{ public static void main(String[] args) { System.out.println(str); } } outs Exception in thread "main" java.lang.Error: Unresolved compilation problem: The field str is ambiguous at test.core.F.main(NullReferenceTest.java:45) I don't see striking differs beetwen both variants. I