Java Arithmetic Operators

1. Arithmetic Operators: 

They are used to perform basic arithmetic operations. They perform on primitive data types.
They are:

  • * : Multiplication
    Multiplies two values
    Example: x * y;
  • / : Division
    Divides one value from another
    Example: x / y;
  • % : Modulo
    Returns the division remainder
    Example: x % y;
  • + : Addition
    Adds together two values
    Example: x + y;
  • – : Subtraction
    Subtracts one value from another
    Example: x - y;

Example of Arithmetic Operator

Output: