Created
January 18, 2013 14:25
-
-
Save josephcc/4564860 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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