Expression statements can produce a result.
Details are as follows:
- Empty expressions are permitted.
- All statements must terminate with a semicolon.
The following example sums two values and assigns the result to a variable named z.
z = x + y;
The following example calculates the square root of 9 and assigns the result to a variable named x.
x = Math.Sqrt( 9.0 );
The following example calls a hypothetical function named SetName.
The following example is a statement with an empty expression.