// Example 102 from page 77 of Java Precisely second edition (The MIT Press 2005) // Author: Peter Sestoft (sestoft@itu.dk) import java.util.Random; class Example102 { public static void main(String[] args) { if (args.length != 1) System.out.println("Usage: java Example102 \n"); else { System.out.println("Timing character replacement, abusing a string buffer:"); Random rnd = new Random(); int length = Integer.parseInt(args[0]); char[] cbuf = new char[length]; for (int i=0; i