Which collection is better to store data from multi-dimensional array?
collections, java, multidimensional-array
Solution
ArrayList should do what you need. For instance:
List<List<String>> stringList = new ArrayList<List<String>>(); //A List to store a list of strings
or...
List<String[]> myNumberList = new ArrayList<List<String[]>(); //A List to store arrays of Strings.
Problem
I have a `multi-dimensional array of string`. I am willing to convert it into some collection type, so that I can add, remove and insert elements according my wish. In array I can not remove element at particular position. I need such collection in which I can remove data at particular position, also able to add data at any position. Also dont forget I have multi-dimension array, so the collection should also able to store multidimensional data. Which collection will be suitable for my requirments?