The operators in Java are shown in order of precedence from highest to lowest. Operators at higher precedence are evaluated before those at lower precedence. Most operators associate either left-to-right or right-to-left.
The operators in Java are shown in order of precedence from highest to lowest. Operators at higher precedence are evaluated before those at lower precedence. Most operators associate either left-to-right or right-to-left.
The operators in Java, shown in order of precedence - from highest to lowest
Priority Operators Operation Associativity
[ ] array index 1 () method call left . member access ++ pre- or postfix increment -- pre- or postfix decrement + - unary plus, minus 2 ~ bitwise NOT right ! boolean (logical) NOT (type) type cast new object creation 3 * / % multiplication, division, remainder left + - addition, substraction 4 left + string concatenation << signed bit shift left 5 >> signed bit shift right left >>> unsigned bit shift right < <= less than, less than or equal to 6 > >= greater than, greater than or equal to left instanceof reference test == equal to 7 left != not equal to & bitwise AND 8 left & boolean (logical) AND ^ bitwise XOR 9 left ^ boolean (logical) XOR | bitwise OR 10 left | boolean (logical) OR 11 && boolean (logical) AND left 12 || boolean (logical) OR left 13 ? : conditional right = assignment *= /= += -= %=