This worked for me:
public class HashTable {
private LinkedList table[];
@SuppressWarnings("unchecked")
public HashTable(int size) {
table = new LinkedList[size];
}
}
For example:
HashTable t = new HashTable(10);
t.table[0] = new LinkedList();
t.table[0].add("test");
System.out.println(t.table[0].get(0));
Yes, the constructor generated a warning (that explains the "unchecked" annotation), but afterwards the code works without more warnings.