//
// RandomPass.java
//

/** Generates a random 8-character password. */
public class RandomPass {

  private static final int PASS_LEN = 8;
  private static final char MIN_CHAR = '!';
  private static final char MAX_CHAR = '~';

  public static void main(String[] args) {
    StringBuffer sb = new StringBuffer(PASS_LEN + 2);
    int range = MAX_CHAR - MIN_CHAR + 1;
    for (int i=0; i<PASS_LEN; i++) {
      char c = (char) (range * Math.random() + MIN_CHAR);
      sb.append(c);
    }
    System.out.println(sb);
  }

}

@@ -263,24 +263,128 @@
 g%5B%5D args) %7B%0A
+    int passLen = PASS_LEN;%0A    if (args.length %3E 0) %7B%0A      passLen = Integer.parseInt(args%5B0%5D);%0A    %7D%0A
     StringBu
@@ -410,24 +410,23 @@
 gBuffer(
-PASS_LEN
+passLen
  + 2);%0A 
@@ -485,24 +485,23 @@
  i=0; i%3C
-PASS_LEN
+passLen
 ; i++) %7B

Allow command line parameter to override default number of characters.