We can declare values inline as parameters for methods.
Now, the existing out parameters have been improved in this version. Now we can declare
Use out variables in the argument list of a method call instead of writing separate code Declaration statement.Advantages −
The code is more readable.
No need to assign an initial value.
Existing syntax −
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
1 2 |
|
New syntax −
1 2 3 4 5 6 7 8 9 10 11 12 |
|
1 2 |
|
The above is the detailed content of What improvements have been made to Out parameters in C# 7.0?. For more information, please follow other related articles on the PHP Chinese website!