public class Append { public static void main(String args[]) { // Create a StringBuffer object and // assign it to the variable buf. StringBuffer buf = new StringBuffer(); // Initializes the for loop. // Checks for the number of arguments on // the command line, then loops through them for (int i=0; i< args.length; i++) { // For each argument besides the first, // append comma to end of buffer if (i != 0) { buf.append(", "); } // Add all arguments to the // StringBuffer object buf. buf.append(args[i]); } // Converts the StringBuffer arguments // to simple strings and prints to screen. System.out.println(buf.toString()); } }