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
Because those values aren't increasing by one. They are powers of two and used for testing with bitwise-or, exclusive-or, binary-and, etc.
int[] arr = { 1 << 0, 1 << 1, 1 << 2, 1 << 3 };
System.out.println(Arrays.toString(arr));
Output is
[1, 2, 4, 8]
It's a way of writing 2n where n
is the number to the right of the <<
.