How do I declare a 2D String arraylist?

后端 未结 6 1148
死守一世寂寞
死守一世寂寞 2020-11-28 08:14

I want to do something like this ArrayList> mylist

How can I create it?

How can I add to the external and internal li

6条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 08:39

    List> super2dArray = new ArrayList>()
    

    This is an arraylist of arraylists holding strings.

    Also ArrayList> mylist makes no sense, because String is not a collection/list, but I think you understood that. Future readers might not though.

    See this answer to see why I chose to have List on the left side.

提交回复
热议问题