Why keyword 'this' cannot be used in a static method?

后端 未结 13 1781
遇见更好的自我
遇见更好的自我 2020-12-16 14:13

Why can\'t the keyword this be used in a static method? I am wondering why C# defines this constraint. What benefits can be gained by this constraint?

[

13条回答
  •  既然无缘
    2020-12-16 14:40

    The keyword this refers to the instance of the object. In the static context there is not specific instance to reference.

提交回复
热议问题