title: Static methods can't access instance fields?
body: <p>I have read many article regarding the static fields that</p>
  <blockquote>
  <p>Static methods have no way of accessing fields that are instance
  fields, as instance fields only exist on instances of the type.</p>
  </blockquote>
  <p>But we can create and access the instance fields inside the static class.</p>
  <p>Please find below code,</p>
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
        
      }
  }
  
  class clsA
  {
      
      int a = 1;
  
      // Static methods have no way of accessing fields that are instance fields, 
      // as instance fields only exist on instances of the type.
      public static void Method1Static()
      {
          // Here we can create and also access instance fields
          // which we have declared inside the static method
          int b = 1;
  
          // a = 2; We get an error when we try to access instance variable outside the static method
          // An object reference is required for the non-static field, method, or property
          
          Program pgm = new Program();
          // Here we can create and also access instance fields by creating the instance of the concrete class
          clsA obj = new clsA();
          obj.a = 1;
      }
  }
  </code></pre>
  <p>Is that true &quot;We can access the non static fields inside static method&quot; ?</p>
  <p>Another question If we declare class <code>clsA</code> as static class even at that time we are not getting any compilation error if we declare instance fields inside the static method?</p>
  <p>Where I am getting wrong?</p>