dynamic - inserting into an array of linked lists in java -


i have array of linked lists initialized doing:

hashtable = (t[]) new object[tablesize];  for(int = 0; < tablesize; i++){     hashtable[i] = (t) new linkedlist<t>();     // want add linked list @ element of array     hashtable[i].insert(item); } 

what's correct way of inserting linked list inside of array?

the method "insert" list called add. , need give array type (of list) if want access method.

list[] hashtable = new list[tablesize]; // terrible name array  for(int = 0; < tablesize; i++){     hashtable[i] = new linkedlist<t>();     // want add linked list @ element of array     hashtable[i].add(item); } 

Comments