class I {
private I other;
public void other(I i) {
other = i;
System.out.println(other);
}
}
class J {
private void m1() {
System.out.println("m1");
I i1 = new I();
I i2 = new I();
I i3 = new I();
i1.other(i3);
i2.other(i1);
i3.other(i2);
}
public static void main (String[] args) {
new J().m1();
}
}这是调试的方法
private I other;
public void other(I i) {
other = i;
System.out.println(other);
}
}
class J {
private void m1() {
System.out.println("m1");
I i1 = new I();
I i2 = new I();
I i3 = new I();
i1.other(i3);
i2.other(i1);
i3.other(i2);
}
public static void main (String[] args) {
new J().m1();
}
}这是调试的方法
分配的内存区域都被变量引用。