Can non-static methods modify static variables

前端 未结 9 2138
猫巷女王i
猫巷女王i 2020-11-29 01:53

I am wondering how a non static method can modify a static variable. I know that static methods can only access other static methods and static variables. However, is the ot

9条回答
  •  天命终不由人
    2020-11-29 02:00

    Static members are not instance members , these are shared by class , so basically any instance method can access these static members .

提交回复
热议问题