5Operators and Casts

OPERATORS

C# supports the operators and expressions listed in the following table. In the table, the operators start with the highest precedence and go down to the lowest.

CATEGORY OPERATOR
Primary x.y x?.y f(x) a[x] x++ x-- x! x->y new typeof default checked unchecked delegate nameof sizeof delegate stackalloc
Unary +x -x !x ...

Get Professional C# and .NET, 2021st Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.