I am trying to write a data structure for a hash table using Chaining. When I remove the keyword "static" from a nested class, I get the error message "Can't create a shared array SeparateChaining.Node"? in the line where I allocate memory for hmap using a new one.
It works fine with the static keyword. Anyone please indicate the value of the static keyword here and the difference it makes? I am creating an array of an object, whereas it shows the general array in error (Eclipse)?
public class SeparateChaining<Key,Value> { private int m; private Node[] hmap; private int n; public SeparateChaining() { m=5; n=0;
thanks
Himanshu dewan
source share