[求助]有关接口初始化的问题?
interface I {
int i = 1, ii = Outer.out("ii", 2);
}
interface J extends I {
int j = Outer.out("j", 3), jj = Outer.out("jj", 4);
}
interface K extends J {
int k = Outer.out("k", 5);
}
public class Outer {
public static void main(String[] args) {
System.out.println(K.j);
}
public static int out(String s, int i) {
System.out.println(s + "=" + i);
return i;
}
}
int i = 1, ii = Outer.out("ii", 2);
}
interface J extends I {
int j = Outer.out("j", 3), jj = Outer.out("jj", 4);
}
interface K extends J {
int k = Outer.out("k", 5);
}
public class Outer {
public static void main(String[] args) {
System.out.println(K.j);
}
public static int out(String s, int i) {
System.out.println(s + "=" + i);
return i;
}
}