import java.util.*;
import java.util.ArrayList;
class MyHashTable<K extends Comparable<K>, E> {
private ArrayList<Entry<K,E>> bucket = new ArrayList<Entry<K,E>>();
private int bucketSize;
private int collisionCount = 0;
// Constructor that takes number of buckets as input
public MyHashTable( int len )
{
this.bucketSize = len;
for ( int i = 0; i < len; i++ )
{
bucket.set( i, null ); //ERROR APPEARS ON THIS LINE
}
}
and is evoked when I call from another method :
MyHashTable<MyString, AnimalRecord> linearProbing = new MyHashTable<MyString, AnimalRecord>(59);
linearProbing.put( lion.name, lion );