Synchronized block in the main method
问题 In the below code about the synchronisation between threads, according to the output generated why is the control being transferred to the execution of the new thread despite the lock being acquired for the same object "dt" in the main method ? public class DemoThread extends Thread { public DemoThread() { } public void run() { int i=0; synchronized(this) { while(++i<=5) { sum=i; try{ sleep(1000); System.out.println("Woke up from sleep"); if(i>=2) this.notify(); }catch(InterruptedException ie