List删除指定区域的元素
The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa.
简单来说,对子List的任何操作,都会同步影响到原来的父List数据。而对父List的元素做了操作,同样会subList获取的子List里的元素产生影响。说白了,subList获取到的子List本质上就是原来父List一部分元素的映射,双方的子元素实际上是同一批对象。而在注释中也很明白的说到,我们可以用
list.subList(from, to).clear();
标签:returned,删除,List,元素,list,指定,subList
From: https://www.cnblogs.com/aclq/p/17679692.html