CodeSteps

Python, C, C++, C#, PowerShell, Android, Visual C++, Java ...

C# – Modifiers – static Modifier

Another interesting modifier C# provides is static modifier. We can use this on classes & it’s members.

The static Modifier

A static member can be declared using static modifier. static is the keyword we use to define the static members. static members belongs to the type itself; not to associate with specific objects.

When we apply static modifier on the class; the class will become a static class. static classes can not be instantiated. That means, it is NOT allowed to create objects from static classes. We can call it’s members or methods using class name itself. For example, Class_Name.Property_Name.

Non-static classes can contains static members. static members can not be accessed through instances of the classes.

We will discuss more topics as we go.

(Raju)

C# – Modifiers – static Modifier

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top