Versions Compared

Key

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

...

Here, b is first converted to int so that the + operator can be applied to operands of the same type. The result of (a+b) is then converted to a float, and the comparison operator is finally applied.

Also, see EXP04-J. Be wary of invisible implicit casts when using compound assignment operators and EXP05-J. Be careful of autoboxing when removing elements from a Collection.

Noncompliant Code Example

...