Java Arithmetic Operators

In this tutorial you will learn about the Java Arithmetic Operators and its application with practical example.

Java Arithmetic Operators

Arithmetic Operators are used to performing arithmetic operations like addition, subtraction, multiplication, division, %modulus, exponent, etc. Let variable a hold 20 and variable b hold 10, then −

Table Of Contents
Java Arithmetic operators
Operator Name Description Example
+ Addition Addition of given operands
a+b returns 30
- Subtraction Subtraction of second operand from first a-b returns 10
* Multiply Multiplication of given operands a*b returns 200
/ Division Returns Quotient after division
a/b returns 2
% Modulus Returns Remainder after division a%b returns 0

Example:-

When you run the above java program, you will see the following output.

Output:-

java_arithmetic_operators_example

In this tutorial we have learn about the Java Arithmetic Operators and its application with practical example. I hope you will like this tutorial.