Java - Operators

java

Binary operators:

Operator Meaning
~ Bitwise unary NOT
& Bitwise AND
| Bitwise OR
^ Bitwise exclusive OR
» Shift right
»> Shift right, zero filled
« Shift left
value << num // shift value to the left num times
value >> num // shift value to the right num times

Comparison operators:

Operator Meaning
== Equals
!= Not equals
&& Logical AND
|| Logical OR

Operator precedence (highest at the top):

() []
++ -- ~ !
* / %
+ -
>> >>> <<
> >= <  <=
== !=
&
^
|
&&
||
?:
=
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License