- Arithmetic operators:
- Assignment operators:
- Comparison operators:
- Logical operators:
- Binary operators:
- Type conversion:
Operator Categories
|
Category
|
Operators
|
|
Arithmetic
|
-, +, *, /, %, ++, --
|
|
Assignment
|
=, +=, -=, *=, /=, %=, &=, |=, ^=,
|
|
Comparison
|
==, !=, >, <.
|
|
Logical
|
&&, ||, !, ^
|
|
Binary
|
&, |, ^, ~, <<, >>
|
|
String concatenation
|
+
|
|
Type conversion
|
(type), as, is, typeof, sizeof
|
|
Other
|
., new, (), [], ?:, ??
|
Operator Precedence in C#
|
Priority Operators
|
Operators
|
|
Highest priority
|
(, ) ++, -- (as postfix), new, (type), typeof, sizeof ++, -- (as prefix), +, - (unary), ! , ~ *, /, % + (string concatenation) +, - <<, >> <, >, <=, >=, is, as ==, != &, ^, | |
|
Lowest priority
|
&&
|| ?: , ?? =, *=, /=, %=, +=, -=, <<=, >>=, &=, ^=, |= |
0 nhận xét:
Đăng nhận xét