java - add 2d arraylist to 3d arraylist -



java - add 2d arraylist to 3d arraylist -

i have got 3d arraylist , each dimension of want add together temporary 2d arraylists. example

list<list<integer>> perm = new arraylist<list<integer>>(); list<list<list<integer>>> list1 = new arraylist<list<list<integer>>>(); list1.get(0).add(perm); list1.get(1).add(perm);

but 1 not work. tells me

method add(list<integer>) in type list<list<integer>> not applicable arguments (list<list<integer>>)

look @ types more closely - you're trying add together list<list<integer>> first list within list1 (because you've called get(0).)

this first list (inside topmost arraylist) of type list<integer>, not list<list<integer>> - types don't match, , compile error.

java arraylist

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -