Running wait() on a Thread instance from within main() in Java
问题 I am playing around with the timed version of wait() in java.lang.Object and have observed that it acts differently in two different scenarios. Scenario1: Using the default definition of run() in Thread public static void main (String[] args) throws InterruptedException { Thread t = new Thread(); t.start(); System.out.print("X"); synchronized(t) { t.wait(10000);} System.out.print("Y"); } Questions on scenario1: I am experiencing a delay between X and Y. Is this because I am calling wait()