// This program uses some of the methods of java.lang.StringBuffer.
// Barry Cornelius, 29 May 2000
public class SimpleStringBuffer
{
   public static void main(final String[] pArgs)
   {
      final String tName = new String("James Gosling");
      System.out.println(tName);
      final char tFirstChar = tName.charAt(0);
      final int tPositionOfSpace = tName.indexOf(" ");
      final StringBuffer tNewNameBuffer = new StringBuffer(tName);
      tNewNameBuffer.delete(0, tPositionOfSpace + 1);
      tNewNameBuffer.append(", ");
      tNewNameBuffer.append(tFirstChar);
      final String tLabel = tNewNameBuffer.toString();
      final String tUpperLabel = tLabel.toUpperCase();
      System.out.println(tUpperLabel);
   }
}
