try below code to test your concept of class Locking and classLoader. I will post the
reason of output next week till then you do your finding !!
public class VerifyClassLoadingOnClassLock { public static void main(String[] args) { show(); } private static void show() { synchronized (SharedQ.class) { System.out.println(" Method Show() executing from Main() .... "); } } } class SharedQ { static { System.out.println(" Classloader is loading SharedQ "); } public static void writeStream() { // some multiThread code here } }