What's a “static method” in C#?

前端 未结 9 2041
再見小時候
再見小時候 2020-11-22 06:48

What does it mean when you add the static keyword to a method?

public static void doSomething(){
   //Well, do something!
}

Can you add the

9条回答
  •  隐瞒了意图╮
    2020-11-22 07:23

    When you add a "static" keyword to a method, it means that underlying implementation gives the same result for any instance of the class. Needless to say, result varies with change in the value of parameters

提交回复
热议问题