java学习
NewUser2771894007
这个作者很懒,什么都没留下…
展开
-
java List.subList相关的ConcurrentModificationException
subList方法返回的List底层使用的仍然是原list,当对原list进行了结构化修改后(例如增加元素或者删除元素),遍历subList将导致异常。 官方文档 The semantics of the list returned by this method become undefined if the backing list (i.e., this list) isstructurally modifiedin any way other than via the returned lis..原创 2020-08-14 14:35:16 · 249 阅读 · 0 评论 -
使用Runnable实现数据共享
使用Runnable实现数据共享先上代码:public class TestThread { private static final Logger logger = LoggerFactory.getLogger(TestThread.class); private final class MyRunnable implements Runnable { privat原创 2018-03-20 19:53:25 · 899 阅读 · 0 评论