question under: interface Foo{ int k=0; } public class Test implements Foo{ public static void main(String args[]){ int i; Test test=new Test(); i=test.k; i=Test.k; i=Foo.k; } } Which statement is true? A. Compilation succeeds B. An error at line 2 causes compilation to fail C. An error at line 9 causes compilation to fail D. An error at line 10 causes compilation to fail E. An error at line 11 causes compilation to fail the answer is A i do not understand why ?
Panday Manako
Ranch Hand
Joined: Mar 29, 2001
Posts: 80
posted
0
fields in interfaces are automatically static and final