I'm brand new to Java, programming, and StackOverflow. I need to use a list where I can add or remove things and don't know the initial size (like ArrayList) but I also need it to be two dimensional. I've read on Google and StackOverflow and I can't find a concrete answer. Is this a possibility? And if not can you point me in the right direction? Thanks in advance.
ArrayList<ArrayList> arrList2D = new ArrayList<ArrayList>(2);
arrList2D.add(new ArrayList());
arrList2D.add(new ArrayList());
arrList2D
is a 2D ArrayList.
well you can always try writing a simple code and see if this work. By the way you can use Array list in array list and I am pretty sure it will be a very bad idea.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With