Usage of named parameters

后端 未结 5 1279
情歌与酒
情歌与酒 2021-01-06 11:04

Sorry, if duplicate.

I\'m reading CLR via C#. Chapter \"Parameters\" starts with the explanation of optional and named parameters.

So, can you give some exam

5条回答
  •  情歌与酒
    2021-01-06 11:33

    Suppose you have 5 optional boolean parameters, and you only want to pass in one of them.

    Using named parameters lets you do that without any ambiguities.

提交回复
热议问题