Arithmetic Operators in Java

In java, operators are the special symbol that performs operations like addition, subtraction, multiplication and many more on one-two or more operands.

In java there are following types of operators available.

  1. Arithmetic Operators.
  2. Relational Operators.
  3. Logical Operators.
  4. Assignment Operators
  5. Increment/Decrement Operators.
  6. Conditional Operators.
  7. Bitwise Operators.
  8. Special Operators

Now, let’s begin with understanding of each and every operator, one by one.

  1. Arithmetic Operators.

In java arithmetic operators are used to perform operations like addition, division, multiplication, subtraction and modulo. Basically its the counterpart of your maths.

Operator’s SymbolDescription of the Operator
+ (Addition)This operator is used to perform the addition of two numbers.
For example a+b.
– (Subtraction)This operator is used to perform the subtraction of two numbers.
For example a-b.
* (Multiplication)This operator is used to perform the multiplication of two numbers.
For example a*b.
/ (Division)This operator is used to perform the division of two numbers.
For example a/b.
% (Modulo)This operator gives the remainder.
For example a%b.

You can find code here

Rutu Shah