Arithmetic Operators


Java arithmetic operators are used to perform arithmetic/mathematical operations on the operands.

1. + (Addition)

System.out.print(10 + 8);

// prints 18

2. - (Subtraction)

System.out.print(10 - 8);

// prints 2

3. * (Multiplication)

System.out.print(10 * 8);

// prints 80

4. / (Division)

System.out.print(10 / 8);

// prints 2

5. % (Modulus)

System.out.print(10 % 8);

// prints 2

6. ++ (Increment)

int a = 5;
a++;

System.out.print(a);

// prints 6

7. -- (Decrement)

int a = 5;
a--;

System.out.print(a);

// prints 4