public class TestClass {
int i = 0;
volatile boolean tmpvo = false;
public void one() {
i = 1; //
tmpvo = true; //
}
public void two() {
if(tmpvo) { //
int j = i; //
//......
}
}
}
suppose that after the one () method is executed by thread 1, the method two () is executed by thread 2. Which of the following conforms to the rules of happens-before? Radio
A, integer variable happens-before assignment operation
B, Boolean variable happens-before judgment operation
C, integer variable happens-before Boolean variable
D, judgement operation happens-before assignment operation