The Java language provides 7 operators that perform arithmetic on integer and floating point values.

  1. This is often incorrectly referred to as the “modulus” operator. “Remainder” is the term that is used by the JLS. “Modulus” and “remainder” are not the same thing.

Operand and result types, and numeric promotion

The operators require numeric operands and produce numeric results. The operand types can be any primitive numeric type (i.e. byte, short, char, int, long, float or double) or any numeric wrapper type define in java.lang; i.e. (Byte, Character, Short, Integer, Long, Float or Double.

The result type is determined base on the types of the operand or operands, as follows:

The result type of the operation determines how the arithmetic operation is performed, and how the operands are handled