O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8.2. Static members

This section covers static members in general. More information on static methods can be found in section 7.12.

The use of static in C# is almost identical to the use of the same keyword in Java. A class member declared without the static modifier is considered non-static or belonging to an instance. A static member of a class does not belong to an instance of this class, but rather to the whole class itself. A non-static member of a class is also known as an instance member.

A static field identifies only one storage location so that no matter how many instances of this class are created, there is only one copy of this static field for a particular application domain. [3] The following is an example showing the use of static ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required