java - create 2d list of sets -
java - create 2d list of sets -
this question has reply here:
cannot instantiate type set 3 answersi trying 2d grid/array each cell set. purpose utilize next code example
list<set<integer>> grid = new arraylist<set<integer>>(); // in line set underlined error grid.add(new set<integer>()); grid.get(0).add(2);
but says - "cannot instantiate type set". want instantiate new list dimension , each of dimension cells should sets? , comes question how iterate efficiently through grid?
set
interface, neeed instanciate specific implementation of set, illustration hashset
.
java arrays collections interface set
Comments
Post a Comment