• Meaning: An Operator is a symbol that is used to provide new values from one or more operands. The output of most operations is a Numeric value or a Boolean.
• There are Four General Classes of Operators: Arithmetic, Relational, Logical, and Bitwise.
·
1. Arithmetic
Operators:
Operator
|
Meaning
|
+
|
addition
|
-
|
Subtraction(also unary minus)
|
*
|
multiplication
|
/
|
division
|
%
|
modulus
|
++
|
increment
|
--
|
decrement
|
·
2. Relational
Operators: Relational refers to the relationships that values have with each
other.
Operator
|
Meaning
|
==
|
Equal to
|
!=
|
Not equal to
|
>
|
Greater than
|
<
|
Less than
|
>=
|
Greater than or equal to
|
<=
|
Less than or equal to
|
·
3. Logical Operators:
logical means the ways true and false values are to be connected together.
Operator
|
Meaning
|
&
|
AND
|
|
|
OR
|
^
|
XOR(exclusive OR)
|
||
|
Short-circuit Or
|
&&
|
Short-circuit AND
|
!
|
NOT
|
·
The output of Relational and Logical operators is a Boolean
value.
·
Operator Precedence: Order of precedence from
highest to lowest.
highest
|
|
|
|
()
|
[]
|
|
|
++
|
--
|
~
|
!
|
*
|
/
|
%
|
|
+
|
-
|
|
|
>>
|
>>>
|
<<
|
|
>
|
>=
|
<
|
<=
|
==
|
!=
|
|
|
&
|
|
|
|
^
|
|
|
|
|
|
|
|
|
&&
|
|
|
|
||
|
|
|
|
?:
|
|
|
|
=
|
Op=
|
|
|
lowest
|
|
|
|
Tags
Java