What can I do with a protected/private static variable?

前端 未结 7 2290
悲&欢浪女
悲&欢浪女 2021-01-01 18:00

I see I can write :

protected static

in my C# class (in my case, an aspx.cs). As well as :

private static

7条回答
  •  滥情空心
    2021-01-01 18:33

    Static is a modifier.. And protected and private are access modifier. Access modifier specify the scope of the variable. Static modifier is used when we want field or method to be singleton thus we don't have to access them by creating the object , rather they can be called through class name directly

提交回复
热议问题