| |
|
A static member belongs to the class rather than to the instances of the class.
In C# data fields, member functions, properties and events can be declared
static. When any instances of the class are created, they cannot be used to
access the static member. To access a static class member, use the name of the
class instead of an instance variable Static methods and Static properties can
only access static fields and static events. Like: int i = Car.GetWheels; Here
Car is class name and GetWheels is static property. Static members are often
used to represent data or calculations that do not change in response to object
state.
|
|