问题:有一个类Foo如下:
public class Foo{
private int i = 0;
public void f(){
System.println("In f() i=" + i);
}
public synchronized void g(){
//point 1
System.println("In g() i=" + i);
i = 1;
//point 2
System.println("In g() i=" + i);
}
}
请问如果有两个线程A,B,线程B执行到point 2时,问线程A总会打印出"In f() i=1"吗?