title: Exact difference between CharSequence and String in java
body: <p>I read this <a href="https://stackoverflow.com/questions/3600635/what-is-the-difference-between-charsequence-and-a-string">previous post</a>. Can any one say what the exact difference between <code>CharSequence</code> and String is, other than the fact that <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html" rel="noreferrer"><code>String</code></a> implements <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html" rel="noreferrer"><code>CharSequence</code></a> and that <code>String</code> is a sequence of character? For example:</p>
  
  <pre><code>CharSequence obj = "hello";
  String str = "hello";
  System.out.println("output is : " + obj + "  " + str);
  </code></pre>
  
  <p>What happens when "hello" is assigned to <code>obj</code> and again to <code>str</code> ?</p>