Operators are shown in decreasing order of precedence from top to bottom with each level of precedence separated by a horizontal line. The associativity of the operators is shown in the right column.???
Table A.1. Operator precedence chart
Operator | Type | Associativity |
---|---|---|
| member access | left-to-right |
| method call | |
| element access | |
| postfix increment | |
| postfix decrement | |
| object creation | |
| get | |
| get size in bytes of a type | |
| checked evaluation | |
| unchecked evaluation | |
| unary plus | right-to-left |
| unary minus | |
| logical negation | |
| bitwise complement | |
| prefix increment | |
| prefix decrement | |
| cast | |
| multiplication | left-to-right |
| division | |
| remainder | |
| addition | left-to-right |
| subtraction | |
| right shift | left-to-right |
| left shift | |
| less than | left-to-right |
| greater than | |
| less than or equal to | |
| greater than or equal to | |
| type comparison | |
| type conversion | |
| is not equal to | left-to-right |
| is equal to | |
| logical AND | left-to-right |
| logical XOR | left-to-right |
| logical OR | left-to-right |
| conditional AND | left-to-right |
| conditional OR | left-to-right |
| null coalescing | right-to-left |
| conditional | right-to-left |
| assignment | right-to-left |
| multiplication assignment | |
| division assignment | |
| remainder assignment | |
| addition assignment | |
| subtraction assignment | |
| left shift assignment | |
| right shift assignment | |
| logical AND assignment | |
| logical XOR assignment | |
| logical OR assignment |