Trying to wrap my head around this code. When I run this - the output will be Roger. Isn't msg a static variable and at a class level thus should print Moore?
EDIT : I've allowed a sleep too allow the child thread to run its course. It also prints printing... Still No Change
public class Test2 { private static String msg = "Roger"; static { new Thread(new Runnable() { public void run() { System.out.println("printing.."); msg += "Moore"; } }).start(); } static { try { Thread.sleep(1000); } catch (InterruptedException e) { } } public static void main(String argv[]) { System.out.println(msg); } }