为什么打印不出来东西,一RUN就挂起了呢?
public class La{
private static boolean initialized=false;
static{
Thread t=new Thread(new Runnnable(){
public void run(){
initialized=true;
}
});
t.start();
try{
t.join();
}catch (InterruptedExceptionn e){
throw new AssertionError(e);
}
}
public static void main(String args[]){
System.out.println(initialized);
}
}
圣光忏悔 发表于 2015-3-24 12:43
直接new Runnnable接口没有实例化的对象吧?
| 欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |