public class FunnyDeadLock {
  static synchronized void m() {
    System.out.println("hello");
  }

  static {
    Thread t=new Thread() {
      @Override public synchronized void run() {
        m();
      }
    };
    t.start();

    try {
      Thread.sleep(1000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }

    synchronized(t) {
      System.out.println("hello 2");
    }
  }
}