标题: <final问题> Why are final so diao? [打印本页] 作者: cvnmklop 时间: 2014-11-17 20:09 标题: <final问题> Why are final so diao? 本帖最后由 cvnmklop 于 2014-11-17 22:09 编辑
无意之中看到一段代码
public class TTT {
public static void main(String[] args) throws Exception {
for (int i = 0; i < 10; i++) {
final String threadId = "thread_" + i;
Thread thread = new Thread(new Runnable() {
public void run() {
System.out.println(threadId + " started!");
try {
FileInputStream fis = new FileInputStream("/opt/test.log");