以下程序执行后,为什么t2调用i的值得到3呢?哪位高手能详解以下吗?感激不尽!!
public class Transfer {static int i=47;
public void call() {
for (i=0;i<3;i++) {
System.out.print(i+" ");
if(i==2) {
System.out.println("\n");
}
}
}
public Transfer() {
}
public static void main(String[] args) {
Transfer t1=new Transfer();
Transfer t2=new Transfer();
System.out.println(t1.i);
t1.call();
System.out.println(t2.i);
t2.call();
}
}