Is there a method to delete characters?

A good answer might be:

No — only methods that add characters at the end or change selected characters.

Revised Example

There is a reverse() method in class StringBuffer that reverses the order of the characters. Let us conveniently forget about that method and re-write the example program to do the same thing:

public class ReverseTester
{

  public static String reverse( String data )
  {
    StringBuffer temp = new StringBuffer();

    for ( int j=data.length()-1; j >= 0; j-- )
      temp.append( data.charAt(j) );

    return temp.toString();
  }

  public static void main ( String[] args )
  {
    if ( args.length > 0 )
      System.out.println( reverse( args[0] ) );
  }
}

In this version of reverse(), only two new objects are created: the StringBuffer and the returned String object.

QUESTION 7:

Does this program make any assumptions about the size of the string?