Versions Compared

Key

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

...

While this statement is true, arithmetic operations in the Java platform require as much caution as in C and C++. Integer operations can result in overflow because Java does not provide any indication of overflow conditions and silently wraps (Java arithmetic throws an exception only on a division by zero). While integer overflows in vulnerable C and C++ programs may result in execution of arbitrary code, in Java, wrapped values typically result in incorrect computations and unanticipated outcomes.

Wiki Markup
According to the Java Language Specification \[[JLS 0305|AA. Java References#JLS 0305]\], section 4.2.2 Integer Operations:

...