<quote>
interface I {
int i = 1, ii = Test.out("ii", 2);
}
interface J extends I {
int j = Test.out("j", 3), jj = Test.out("jj", 4);
}
interface K extends J {
int k = Test.out("k", 5);
}
class
Test {
public static void main(
String[] args) {
System.out.println(J.i);
System.out.println(K.j);
}
static int out(String s, int i) {
System.out.println(s + "=" + i);
return i;
}
}
produces the output:
1
j=3
jj=4
3
The reference to J.i is to a field that is a compile-time constant;
therefore, it does not cause I to be initialized. The reference to K.j is
a reference to a field actually declared in interface J that is not a
compile-time constant; this causes initialization of the fields of
interface J, but not those of its superinterface I, nor those of
interface K. Despite the fact that the name K is used to refer to field j
of interface J, interface K is not initialized.
</Quote>
Above is an example from JLS, i am clear about J.i
but the K.j portion i am not able to understand as to
how j is non-static ?