title: Replace String with StringBuilder?
body: <p>How i can add a passStringBuilder() method creating a new method that does the same work as passString() does? I need this works with a StringBuilder object rather than a String object. Regards.</p>
  
  <pre><code>import intertech.MyDate;
  public class PassByExperiment {
  
      public static void main(String[] args) {
  
          MyDate date = new MyDate(1, 20, 2008);
          System.out.println("Before passing an object " + date);
          passObject(date);
  
          System.out.println("After passing an object " + date);
          System.out.println("Before passing a primitive " +
          date.year);
  
          passPrimitive(date.year);
          System.out.println("After passing a primitive " +
          date.year);
  
          String x = date.toString();
          System.out.println("Before passing a String " + x);
          passString(x);
          System.out.println("After passing a String " + x); 
      }
  
      public static void passObject(MyDate d) {
          d.year = 2009;
      }
  
      public static void passPrimitive(int i) {
          i = 2010;
      }
  
      public static void passString(String s) 
      {
          int yearSlash = s.lastIndexOf('/');    
          s = s.substring(0, yearSlash + 1);
          s += "2012";
  
          System.out.println("New date string: " + s);
      }
  }
  </code></pre>
  
  <p>This is what i tried:</p>
  
  <pre><code>public static void passStringBuilder(StringBuilder sb) {
     int yearSlashSB = sb.lastIndexOf('/');
     sb = sb.substring(0, yearSlashSB + 1);
     sb.append("2012");
     System.out.println("New date string: " + sb);
  }
  </code></pre>