I don't think you have an overflow but more a NullPointerException
.
The default value for an Object
is null
. When creating the new table, you have an array full of null
values.
You need to initialize each entry of the newHashTable
before trying to get the Vector
at some position and add something into it.
Vector<EstacioHash>[] newHashTable = new Vector[Config.MAX_ESTACIONS];
for (int i=0; i<newHashTable.length;i++){
newHashTable[i] = new Vector<EstacioHash>();
}