こんにちは、Javaでフラグを削除する必要があります。私は以下の定数を持っています:Javaでフラグを削除する方法
public final static int OPTION_A = 0x0001;
public final static int OPTION_B = 0x0002;
public final static int OPTION_C = 0x0004;
public final static int OPTION_D = 0x0008;
public final static int OPTION_E = 0x0010;
public final static int DEFAULT_OPTIONS =
OPTION_A | OPTION_B | OPTION_C | OPTION_D | OPTION_E;
デフォルトのオプションからOPTION_Eを削除したいと思います。次のコードが正しくないのはなぜですか?
// remove option E from defaul options:
int result = DEFATUL_OPTIONS;
result |= ~OPTION_E;
JVMはあなたに何を伝えますか? SOから戻ってくるのを待っているよりも速く走っていないでしょうか?あなたは今これを3回やり遂げることができました。 – duffymo