Variables are available in Java, which are the important aspects of code. To store the values, reserved memory locations are needed which are called Variables. To manipulate the variables, we have the operators available in Java. There are different types of operator in Java such as **Arithmetic Operators, Bitwise Operators, Logical Operators,** and Some other Miscellaneous Operators. Today let us get to know about some of the mostly used and required operators in Java.

**The Arithmetic Operators:**

As we use algebra in mathematical expressions, we use Arithmetic operators in the same way for calculations. Arithmetic operators constitute of the following list.

For example, let us assume that the variable A and B hold the values 20 and 30 respectively, now we check the operators on them.

1 |
This adds the values of variables on both the sides of the operator. For Example A + B will give 50 |

2 |
Left hand operand is subtracted from the right-hand operand For Example A – B will give -10 |

3 |
Values on both the sides of the operator are multiplied For Example A * B will give 600 |

4 |
Left-hand and the right-hand operands are divided For Example B / A will give 1.5 |

5 |
The remainder is resulted when left-hand operand is divided by a right-hand operand. For Example B % A will give 1 |

6 |
Value of the operand is increased by 1. For Example B++ gives 31 |

7 |
Value of the operand is decreased by 1. For Example B– gives 29 |

**The Relational Operators:**

To compare two numbers in Java is one by the relational operators and they return a Boolean value which gives a true or false value. Following are the relational operators exists in Java language

Let us have an example where variable A and B has the values 10 and 20 respectively, then

1 |
It is used to check the values of two given operands are same or not, if same it returns true value otherwise false. |

2 |
It is used to check the values of two given operands are same or not, if same it returns false value otherwise true. |

3 |
The result of this condition becomes true if the left operand’s value is greater than the value of the right operand. |

4 |
The result of this condition becomes true if the left operand’s value is less than the value of the right operand. |

5 |
The result of this condition becomes true if the left operand’s value is greater than or even equal to the value of the right operand.
In the same way, there is also <= less than or equal to. |