title: What kind of memory will allocate in Java?
body: <p>Someone kindly clear my doubt on memory management in Java with the below-mentioned scenario.</p>
  
  <p>When we assign value for the primitive data type variable the value will be stored in stack memory. Please do correct me if I understood the concept wrong.</p>
  
  <p>As same like how the memory will allocate when do assign a value of a non-primitive data type as mentioned below.</p>
  
  <pre><code>Integer a = 3;
  </code></pre>
  
  <p>Will create a memory in stack or heap?</p>