Hi every one in javarach
i got a question like that
nterface 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;
}
}
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 given answer is a .
I checked a by running the program,is just ok.Its seemed that K in interface Foo has been extended by the class and was made someting like static value.Its ture ?