Java-Basics-Operators
Java-Basics-Operators
OPERAT DESCRIPTION
OR
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
++ Increment (x = x+1)
-- Decrement (x = x-1)
RELATIONAL OPERATORS
OPERAT DESCRIPTION
OR
== equal to
!= not equal to
> greater than
< less than
>= greater than or equal to
<= less than or equal to
BITWISE OPERATORS
OPERAT DESCRIPTION
OR
& bitwise AND
| bitwise OR
^ bitwise XOR
~ 1’s Complement
<< Binary shift left
>> Binary shift right
>>> zero fill right shift
LOGICAL OPERATORS
OPERAT DESCRIPTION
OR
&& logical and
|| logical or
! logical not
ASSIGNMENT OPERATORS
OPERAT DESCRIPTION
OR
= simply assign
+= add then assign
-= subtract then assign
*= multiply then assign
/= divide then assign
%= get the modulo then assign
<<= binary shift left then assign
>>= binary shift right then
assign
ASSIGNMENT OPERATORS
OPERAT DESCRIPTION
OR
&= do bitwise AND then assign
|= do bitwise OR then assign
^= do bitwise XOR then
assign
CONDITIONAL/TERNARY OPERATOR