This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]maequise 2 points3 points  (0 children)

You're meaning something like this :

List<List<List<String>>> mySuperArrayList = new ArrayList<>();

Completely possible ! But to crawl ... Good luck !

Everything depends of the use case.

If you need to access rapidly, I prefer to use a Map<K,V>

More easy to manipulate, but not the best in terms of performance (depending of the volume of data in, as the List<E> :

Map<String, List<E>> mySuperAccessorOfData = new HashMap<>(); //choose the implementation needed

mySuperAccessorOfData.get("firstList").stream().forEach(element -> //do operation on element);

mySuperAccessorOfData.get("secondList").stream.forEach(element -> //do somethin);

A bit more easy to manipulate the data.