摘要: 当年我也被这个问题困扰过,背了答案但总觉得哪里不对。后来想通了,其实就一个核心问题:变量没了,内部类还在,怎么办? 先看现象 public void test() { int count = 0; new Thread(() -> { System.out.println(count); // 这行 阅读全文
posted @ 2026-01-15 13:49 甜菜波波 阅读(1) 评论(0) 推荐(0)