View Single Post
  #1 (permalink)  
Old 12-16-2007, 05:49 PM
jhetfield18 jhetfield18 is offline
Member
 
Join Date: Oct 2007
Posts: 9
jhetfield18 is on a distinguished road
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????
Reply With Quote
Sponsored Links