title: Difference between heap memory and string pool
body: <p>What is the difference between heap memory and string pool in Java?</p>
  
  <p><a href="https://www.quora.com/What-is-the-difference-between-String-s1-Hello-and-String-s1-new-String-Hello-in-Java" rel="noreferrer">in this link</a> , it is said that:</p>
  
  <pre><code>String s1 = "Hello";
  
  String s2 = new String("Hello");
  </code></pre>
  
  <p>s1 points to String Pool's location
  and
  s2 points to Heap Memory location.</p>