集合
又菜又爱哭
这个作者很懒,什么都没留下…
展开
-
ArrayList的subList使用过程中的注意事项
subList()是返回集合在区间[startIndex, endIndex)的元素集合 public static final void main(String[] args) { List<String> stringList = new ArrayList(){{ add("test0"); add("test1"); add("test2"); add("test3");原创 2021-05-24 09:56:46 · 150 阅读 · 0 评论 -
为什么使用Arrays.asList(),添加元素会报系统异常
public static final void main(String[] args) { List<Integer> numList = Arrays.asList(1, 2, 3); try { numList.add(4); } catch (Exception exception) { exception.printStackTrace(); } System原创 2021-05-24 09:19:43 · 241 阅读 · 0 评论