void gen() { System.out.println("Link control.gen() works"); //We must set the first and last entrys before we add anything else, otherwise the java program throws a fit LinkObject.addFirst(randomData()); LinkObject.addLast(randomData()); //loop through and add 10 more entrys for (i = 1; i<=10; i ++){ LinkObject.add(i,randomData()); } // purely for debuging, just to check the list iterator = LinkObject.iterator(); Object[] a = LinkObject.toArray(); for (int i=0; i< a.length; i++){ System.out.println("Here :" + a[i]); } }