public class Lazy {
private static boolean initialized = false;
static {
Thread t = new Thread(() -> initialized = true);
t.start();
try {
t.join();
} catch (InterruptedException e) {
throw new AssertionError(e);
}
}
public static void main(String[] args) {
System.out.println(initialized);
}
}
以上程序输出内容是?
A. true
B. false
C. 编译错误
D. 以上答案都不对