To directly answer your question: it is not an expression statement; it is a declaration statement with initialization.
The difference between an expression and a statement is that the execution of a statement doesn't produce a value whereas an expression does. So statements have side-effects but produce no value while expressions can both have side-effects and produce a value. Multiple expressions can make up a statement but there can only be one statement per "line" (line defined by ;).
int i;
i = 123;
Console.WriteLine(i);
++i;
i++;
Console.WriteLine(i);
"Expression statements" are just expressions that are used for their side-effects only and the result of the expression is ignored; it's an expression used as if it were a statement. So above with
i++
, we're indicating we only care about the side-effect of incrementing
i
and not the return value. Another example:
j = i = 123;
Here the whole
j = i = 123
is an expression statement that uses the expression
i = 123
. But with
int j = i = 123;
int j = i = 123
is a declaration statement that uses the expression
i = 123
.
Hope that helps.