Two dimensional array list

前端 未结 9 1309
梦毁少年i
梦毁少年i 2020-11-28 05:09

I\'ve heard of using a two dimensional array like this :

String[][] strArr;

But is there any way of doing this with a list?

Maybe s

9条回答
  •  无人及你
    2020-11-28 05:29

    A 2d array is simply an array of arrays. The analog for lists is simply a List of Lists.

    ArrayList> myList = new ArrayList>();
    

    I'll admit, it's not a pretty solution, especially if you go for a 3 or more dimensional structure.

提交回复
热议问题