|
HashTable problem
Hi I have to make a HashTable.And I want to implement it by declaring an array of LinkedLists<Object> where the Object is a Connection struct that contains two strings.I declare it like this:
private LinkedList<Connection>[] Connections;
public HashTable(int m) {
this.n = 0;
this.m = m;
//this.HS = hs;
for (int i = 0; i < m; i++) {
this.Connections[i] =new LinkedList<Connection> ();
}
}
But its wrong and if I try the usual:
private LinkedList<Connection>[] Connections=new LinkedList<Connection> [size];
It throws a cannot create generic array of LinkedList<Connection>.
What can I do to fix it????
|