title: Where are static members stored in memory? stack/ heap in C# .Net
body: <p>The earlier post dealt with the value and reference types and their memory allocation.</p>
  
  <p>Here I'm trying to understand the memory allocation of static members.</p>
  
  <p>I have a simple class which has got both static and non-static integers like one shown below.</p>
  
  <pre><code> class Sample
   {
     public int nonStaticInt = 0;
     public  static int staticInt = 0;
   }
  </code></pre>
  
  <p>My question here is, where do static integer reside? Stack/ a Heap. And how do they get into memory first even before any object creation.  </p>
  
  <p>Thanks!</p>