How to fill a List of Lists?

后端 未结 3 2044
我在风中等你
我在风中等你 2021-01-26 20:47

I create a list of lists like this:

List tmp = new ArrayList(2);

Then I\'d like to insert 10 to first sub-list as follo

3条回答
  •  野性不改
    2021-01-26 21:03

    You haven't added anything to the list yet. Declaring a List of any type with an initial capacity of 2 doesn't automatically populate that. You have to do that first.

提交回复
热议问题