Searching...
Chủ Nhật, 18 tháng 9, 2016

[C#] Operators and Expressions

Operators in C#
- 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

 
Back to top!