Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
This code can fail due toas a result of the verysame errors it is attempting to prevent. When {{array}} is null or when {{i}} is not a valid index, the reference to {{array\[i\]}} will cause a {{NullPointerException}} or an {{ArrayIndexOutOfBoundsException}} to be thrown. This happens because the {{&}} operator fails to prevent evaluation of its right operand, even when evaluation of its left operand proves that the right operand is invalid.

...