Learning C # static member of the class

We can use the static keyword to class members defined as static. When we declare a class member is static, meaning that no matter how many objects class is created, there is only one copy of the static members. The keyword static means that only one instance of the class members. Static variables used to define constants, because their value can be called directly without the need to create an instance of the class class to obtain. Static variables can be initialized in the definition of the external function or class member. You can also initialize static variables within the class definition.

Guess you like

Origin www.cnblogs.com/zhaoxure/p/12040294.html