title: Memory allocation on object creation
body: <p>how much memory it will be allocated in stack as well as in heap when we instantiate the class/struct Student?</p>
  
  <p>I guess id = 4 bytes reference (32 bit machine) and name = 4 bytes reference and facultyAdvisor = 4 bytes reference. So totally 12 bytes in stack and actual size will be in heap. this heap size may vary depends upon the value that we assign to the fields(id, name, facultyAdvisor) that uses object obj(Student obj = new Student())</p>
  
  <p>The same is for struct also right?</p>
  
  <pre><code>public class Student { int id; string name; Professor facultyAdvisor; }
  
  public struct Student { int id; string name; Professor facultyAdvisor; }
  </code></pre>