Static members can be accessed at any time without an instance of the class - that doesn't stop instance methods from accessing static information.
See the answers to your previous - rather similar - question yesterday:
When to use static methods C#[
^]
Quote:
Thank u but static method perform the operation only static fields or not i.e static methods are access instance fields for perform the operation is possible?
Static methods can only access static fields, properties, methods, etc. - they cannot access instance anything because there is no instance present when they are running: there is no
this
reference to access instance data via.
The only exceptions to that are when an instance is pass to a static method, or the static method creates it's own instance:
public void DoSomething()
{
Console.WriteLine(this.Text);
}
public static void MyMethod(MyClass mc)
{
mc.DoSomething();
}
Or
public void DoSomething()
{
Console.WriteLine(this.Text);
}
public static void MyMethod()
{
MyClass mc = new MyClass();
mc.DoSomething();
}