为什么打印不出来东西,一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); } }
|