Operators are special symbols that perform specific operations on operands, and then return a result. The following are the operators supported by the Java programming language:
The operators in the following table are listed according to the precedence order. Operators with higher precedence are evaluated before operators with relatively lower precedence. Operators on the same line have equal precedence.
Precedence |
Name |
Operators |
Associativity |
---|---|---|---|
1 |
postfix |
|
Right to Left |
2 |
unary |
|
Right to Left |
3 |
multiplicative |
|
Left to Right |
4 |
additive |
|
Left to Right |
5 |
shift |
|
Left to Right |
6 |
relational |
|
Left to Right |
7 |
equality |
|
Left to Right |
8 |
bitwise AND |
|
Left to Right |
9 |
bitwise exclusive OR |
|
Left to Right |
10 |
bitwise inclusive OR |
|
Left to Right |
11 |
logical AND |
|
Left to Right |
12 |
logical OR |
|
Left to Right |
13 |
ternary |
|
Right to Left |
14 |
assignment |
|
Right to Left |
Note
Reference link for Java operators
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html