Are parameters evaluated in order when passed into a method?

后端 未结 3 1422
春和景丽
春和景丽 2020-12-11 00:03

Are parameters evaluated in order when they passed into a method?

For Java it\'s always true, for C it isn\'t, but what is the answer for C#?

Sample

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-11 00:52

    From the language specification:

    During the run-time processing of a function member invocation, the expressions or variable references of an argument list are evaluated in order, from left to right.

提交回复
热议问题