How main thread runs before this thread?
问题 I have the following code: public class Derived implements Runnable { private int num; public synchronized void setA(int num) { try { Thread.sleep(1000); } catch (InterruptedException e) { } System.out.println("Setting value " + Thread.currentThread().getName()); this.num = num; } @Override public void run() { System.out.println("In run: " + Thread.currentThread().getName()); setA(20); } public static void main(String[] args) { Derived obj = new Derived(); Thread t1 = new Thread(obj); t1