FileDocCategorySizeDatePackage
StringBuilderTester.javaAPI DocExample716Wed May 05 22:24:44 BST 2004com.oreilly.tiger.ch01

StringBuilderTester

public class StringBuilderTester extends Object

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.StringappendItems(java.util.List list)

    StringBuilder b = new StringBuilder();

    for (Iterator i = list.iterator(); i.hasNext(); ) {
      b.append(i.next())
       .append(" ");
    }

    return b.toString();
  
public static voidmain(java.lang.String[] args)

    List list = new ArrayList();
    list.add("I");
    list.add("play");
    list.add("Bourgeois");
    list.add("guitars");
    list.add("and");
    list.add("Huber");
    list.add("banjos");

    System.out.println(StringBuilderTester.appendItems(list));