Java Operator
Java Operator
PROGRAMMING
JAVA OPERATORS
JAVA OPERATORS
Operators constitute the basic building block to any programming language. Java too
provides many types of operators which can be used according to the need to perform
various calculation and functions be it logical, arithmetic, relational etc. They are
classified based on the functionality they provide. Here are a few types:
• Arithmetic Operators
• Assignment Operator
• Unary Operators
• Relational Operators
• Logical Operators
Arithmetic Operators
• These operators involve the
mathematical operators that can
be used to perform various simple
or advance arithmetic operations
on the primitive data types
referred to as the operands.
These operators consist of various
unary and binary operators that
can be applied on a single or two
operands respectively. Let’s look
at the various operators that Java
has to provide under the
arithmetic operators.
• Additional - This operator is a binary • Modulus(%): This is a binary operator
operator and is used to add two that is used to return the remainder
operands when the first operand(dividend) is
• Subtraction - This operator is a binary divided by the second
operator and is used to subtract two operand(divisor).
operands • Increment(++): This is a unary operator
• Multiplication - This operator is a binary that acts on one operand, unlike the
operator and is used to multiply two previous operations. It is used to
operands increment the value of an integer. It
• Division - This is a binary operator that can be used in two ways
is used to divide the first • Decrement(–): This is also a unary
operand(dividend) by the second operator that acts on one operand. It is
operand(divisor) and give the quotient used to decrement the value of an
as result integer. It can be used in two ways
SAMPLE