title: Static class memory allocation where it is stored C#
body: <p>I read an article which confused me about memory allocation, which stated:</p>
  
  <blockquote>
    <p><strong>Singleton objects are stored on the heap while static classes are
    stored on the stack.</strong></p>
  </blockquote>
  
  <p>link is :  <a href="http://www.dotnetjalps.com/2013/06/Static-vs-Singleton-in-Csharp-Difference-between-Singleton-and-Static.html" rel="noreferrer">http://www.dotnetjalps.com/2013/06/Static-vs-Singleton-in-Csharp-Difference-between-Singleton-and-Static.html</a></p>
  
  <p>But in some Stackoverflow questions, such as</p>
  
  <p><a href="https://stackoverflow.com/questions/337019/hows-memory-allocated-for-a-static-variable">How is memory allocated for a static variable?</a></p>
  
  <p>It was described like</p>
  
  <blockquote>
    <p><strong>Static variables are stored on the heap, regardless of whether they are declared as a reference type or a value type. There is only one
    slot in total no matter how many instances are created.</strong></p>
  </blockquote>
  
  <p>So I am confused with stack or heap storage for static classes. How is memory allocated for a static class and why? How is memory allocated for singleton class?</p>