public class HashTable {

  String[] arrayTable;
  int arraySize;

  public HashTable(int size) {
    this.arraySize = size;
    this.arrayTable = new String[size];
  }

  /* Simple (and bad) hash function. Maps values to same index for that value. */
  private void hashFunctionIndex(String newElementVal) {
    this.arrayTable[Integer.parseInt(newElementVal)] = newElementVal;

    System.out.println(
      "arrayTable"+ "[" + Integer.parseInt(newElementVal) +"]: "
      + this.arrayTable[Integer.parseInt(newElementVal)]
    );

    return;
  }

  public static void main(String[] args) {
    HashTable ht = new HashTable(17);
    ht.hashFunctionMod("35");
    ht.hashFunctionMod("40");
    ht.hashFunctionMod("45");
    ht.hashFunctionMod("50");
    ht.hashFunctionMod("55");

    ht.hashFunctionMod("60");
    ht.hashFunctionMod("65");
    ht.hashFunctionMod("70");
    ht.hashFunctionMod("75");
    ht.hashFunctionMod("80");

    ht.hashFunctionMod("85");
    ht.hashFunctionMod("90");
    ht.hashFunctionMod("95");
    ht.hashFunctionMod("100");
    ht.hashFunctionMod("105");
  }
}

@@ -544,16 +544,644 @@
 n;%0A  %7D%0A%0A
+  /* Better hash function. Uses modulus index. */%0A  private void hashFunctionMod(String newElementVal) %7B%0A    int arrayIndex = Integer.parseInt(newElementVal) %25 this.arrayTable.length;%0A    System.out.println(%0A      %22Modulus index= %22 + arrayIndex + %22 for value %22 + newElementVal%0A    );%0A%0A    /* If theres a collision, search for the next%0A    available spot using linear probing. */%0A    while(arrayTable%5BarrayIndex%5D != null) %7B%0A      ++arrayIndex;%0A      System.out.println(%22Collision for %22 + newElementVal + %22 try: %22 + arrayIndex + %22 instead%22);%0A      arrayIndex %25= arraySize;%0A    %7D%0A%0A    arrayTable%5BarrayIndex%5D = newElementVal;%0A%0A  %7D%0A%0A
   public

Add another hash function.