Interpolated string expressions that provide convenient syntax to create formatted strings: var r = 2.3 Here are some other kinds of expressions that C# provides: It can be used only as a statement, as the following example shows: Console.WriteLine("Hello, world!") A void method call is an example of an expression that doesn't produce a result. Typically, an expression produces a result and can be included in another expression. In the following code, examples of expressions are at the right-hand side of assignments: int a, b, c You can use parentheses to change the order of evaluation imposed by operator precedence and associativity. Operator precedence and associativity determine the order in which the operations in an expression are performed. You can combine them into complex expressions by using operators. The simplest C# expressions are literals (for example, integer and real numbers) and names of variables. Typically, you can overload those operators, that is, specify the operator behavior for the operands of a user-defined type.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |