title: Is an int inside a class stored on the stack or the heap?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2559271/stack-heap-understanding-question">Stack &amp; heap understanding question</a>  </p>
  </blockquote>
  
  
  
  <p>I was told in <a href="https://stackoverflow.com/questions/5995876/why-var-is-slow">Is using var actually slow? If so, why?</a> that value types are stored on the stack and class types are stored in the heap.</p>
  
  <pre><code>class MyClass
  {
    private int myInt;
    private int[] myInts;
  }
  </code></pre>
  
  <p>Where is <code>MyClass.myInt</code> stored? <code>MyClass</code> is a class/reference type, so it's on the heap. <code>myInt</code> is a value type, so is it stored on some kind of "inside stack"?</p>
  
  <p>Also, what about the array? Is it a value or a class?</p>