Java – Math and Arithmetic Operators in Java




The Java programming language supports various arithmetic operators for all floating point
and integer numbers. These operators are (+)(addition), (-)(subtraction),(*)
(multiplication), (/)(division), and (%)(modulo). The following table summarizes the
binary arithmetic operations in the Java programming language.
Operator Use Description

Operator Use Description
+ op1 + op2 Adds op1 and op2; also used to concatenate strings
op1 – op2 Subtracts op2 from op1
* op1 * op2 Multiplies op1 by op2
/ op1 / op2 Divides op1 by op2
% op1 % op2 Computes the remainder of dividing op1 by op2

So Let’s take an example to understand¬†operators better

OUTPUT:


Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com