# Java arithmetic operators

Java Programming Java8Java Technologies Object Oriented Programming

#### Complete Java Programming Fundamentals With Sample Projects

98 Lectures 7.5 hours

#### C Programming from scratch- Master C Programming

Best Seller

60 Lectures 8 hours

#### C++ Programming

238 Lectures 56.5 hours

Arithmetic operators are used in mathematical expressions in the same way that they are used in algebra. The following table lists the arithmetic operators −

Assume integer variable A holds 10 and variable B holds 20, then

Show Examples

Operator
Description
Example
Adds values on either side of the operator.
A + B will give 30
- (Subtraction)
Subtracts right-hand operand from left-hand operand.
A - B will give -10
* (Multiplication)
Multiplies values on either side of the operator.
A * B will give 200
/ (Division)
Divides left-hand operand by right-hand operand.
B / A will give 2
% (Modulus)
Divides left-hand operand by right-hand operand and returns the remainder.
B % A will give 0
++ (Increment)
Increases the value of operand by 1.
B++ gives 21
-- (Decrement)
Decreases the value of operand by 1.
B-- gives 19

Updated on 30-Jul-2019 22:30:21