重複の可能性:
コンストラクターの競合状態をシミュレートする方法は?
適切に公開されていない値に関する競合状態を示す方法は?
《実際の Java 同時実行》から次のコードを取得しました。
public class Holder{
private int n;
public Holder(int n){this.n = n;}
public void assertSanity(){
if(n != n) throw new AssertionError("This statement is false.");
}
}
条件が気にn != n
なりますが、これは特定の状況下で当てはまるのでしょうか?</p>