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?
[
By static methods you can write:
MyClass.static_method();
which there is nothing to do with any object instance (so you don't need this keyword).
Because static_method() works and doesn't need object instances for its job. static_method() doesn't know which object instance do you have, but it can change the behavior of all object instances:
MyClass a = new MyClass();
MyClass b = new MyClass();
MyClass.static_method("PRINTER");
a.display(); //print something
b.display(); //print something
MyClass.static_method("MONITOR");
a.display(); //display something on monitor
b.display(); //display something on monitor
In this case, static_method() changes the behavior of display() method in all object instances of MyClass.