title: What is difference between mutable and immutable String in java
body: <p>As per my knowledge,</p>
  
  <p>a mutable string can be changed, and
  an immutable string cannot be changed.</p>
  
  <p>Here I want to change the value of String like this,</p>
  
  <pre><code>String str="Good";
  str=str+" Morning";
  </code></pre>
  
  <p>and other way is,</p>
  
  <pre><code>StringBuffer str= new StringBuffer("Good");
  str.append(" Morning");
  </code></pre>
  
  <p>In both the cases I am trying to alter the value of <code>str</code>. Can anyone tell me, what is difference in both case and give me clear picture of mutable and immutable objects.</p>