Skip to content

Instantly share code, notes, and snippets.

@josephcc
Created January 18, 2013 14:25
Show Gist options
  • Save josephcc/4564860 to your computer and use it in GitHub Desktop.
Save josephcc/4564860 to your computer and use it in GitHub Desktop.
public class MainClass {
private static final Object o = new Object();
static {
MyThread thread = new MyThread();
thread.start();
try {
thread.join();
}
catch (InterruptedException e) {
e.printStackTrace();
}
}
public static void main (String[] args)
{
System.out.println("all is well.");
}
static class MyThread extends Thread
{
@Override
public void run ()
{
System.out.println("inside mythread");
o.getClass();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment