Priority




Operators work on operands in a certain order, just like in Mathematics.





1) [ ]   ()     . (dot operator)

2) ++   --    ~ (1's complement)    ! (not operator)    (cast)

3) *   /   % (modulus)

4) unary + and -

5) bit shifts  <<  >>   >>>

6) comparison operators  <  <=  >  >=

7) primitive comparisons  == and !=

8) &  (bitwise and)

9) ^  (bitwise exclusive or)

10 |  (bitwise or)

11) &&  (logical and)

12) ||  (logical or)

13) assignment operators  =, +=, -=, *=, /=, %=