Some int variables in java.awt.Event class is set by bitwise. Like below:
/**
* This flag indicates that the Shift key was down when the ev
Why do this? As pointed out in the other answers, the values are powers of two and you are thereby setting a bit. Suppose you wanted to test for a combination of conditions.
You could then combine bits like for example,
SOME_COMBO_CONDITION = SHIFT_MASK | ALT_MASK
and then test for that condition by testing if both bits are set by doing
current_condition & SOME_COMBO_CONDITION
Using integer codes you'd have to test using a more complex conditional.