7. Expressions

An expression is a sequence of operators and operands. This chapter defines the syntax, order of evaluation of operands and operators, and meaning of expressions.

7.1 Expression Classifications

An expression is classified as one of the following:

• A value. Every value has an associated type.

• A variable. Every variable has an associated type—namely, the declared type of the variable.

Vladimir Reshetnikov

Types of local variables and lambda expression parameters can be inferred by the compiler in many cases, and do not always need to be explicitly specified in declarations.

• A namespace. An expression with this classification can only appear as the left-hand side of a member-access7.6.4). In any other context, an expression ...

Get The C# Programming Language (Covering C# 4.0), Fourth 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.