hi when I wanted to have something like vector of vectors (elements shall be ordered of course) I thought of having arraylist of arraylists but in C++ i would do this to access the element v.at(i).at(j)=5; and when i need to add new element v.at(i).push_back(value);
so how do i do this in java ? because I can only access the outer arraylist but i don’t know how to add new elements…and is there a better way to simulate C++ vector of vectors in java ??
p.s (it’s not a matrix 3*2 for ex but each arraylist may have different size)
Declare an
ArrayListofArraList<Integer>s: