title: Java Append( ) method : String vs. StringBuilder
body: <p>When appending the subset of a String to a String object, the last position in the number of characters specified by the append statement is NOT included as part of the return object. However, when appending the subset of an char Array to a char Array object, the last position in the number of characters specified by the append statement is included as part of the return object. Why is this?</p>
  
  <p>Example -</p>
  
  <pre><code>class  String {
      public static void main(String args[]) {
          StringBuilder sb = new StringBuilder();
          String name = "Java7";
          sb.append(name, 1,3);
          System.out.println(sb);
      }
  }
  /* result is:
  
   av
   */
  
  class  char {
      public static void main(String args[]) {
          StringBuilder sb = new StringBuilder();
          char[] name = {'J', 'A', 'V', 'A', '7'};
          sb.append(name, 1,3);
          System.out.println(sb);
      }
  }
  /* result is:
  
  AVA
  */
  </code></pre>