Core Java 2  Operator Precedence

Rank Operator
1

[ ]  .  ( )  (method call)

2

!  ~  ++  --  +(unary) -(unary) ( ) (cast) new

3 *  /  %
4 + -
5 <<  >>  >>>
6 <  <=  >  >=  instanceof
7 ==  !=
8 &
9 ^
10 |
11 &&
12 ||
13 ?:
14 =   +=   -=   *=   /=   %=   &=   |=   ^=   <<=  >>=  >>>=  

Note there is no comma operator in Java

Send mail to lars@sorcon.com with questions or comments about this web site.
Copyright © 2004 Sorensen Consulting