In Java, & and | evaluate both boolean operands, unlike && and ||. A mistaken operator may compile successfully yet cause unnecessary work, runtime exceptions, or different grouping because non-short-circuit operators have different precedence. section 2.7
A bounds-check typo
In `index >= 0 && index < data.length & data[index] > 0`, the final operand is still evaluated after the bounds condition is false. An out-of-range index can therefore produce ArrayIndexOutOfBoundsException. Use `&&` for dependent checks. section 2.7
Avoid accidental eager evaluation by:
- Using && or || when later operands should run only when necessary. section 2.7
- Adding parentheses or separate if statements when mixing operators with different precedence. section 2.7
