You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicstaticvoidmain(String[] args) throwsInterruptedException { // InterruptedException maine isliye add kiya hai kyunki join method InterruptedException throw kar sakta hai
MyThreadthread1 = newMyThread('*');
MyThreadthread2 = newMyThread('#');
MyThreadthread3 = newMyThread('$');
thread1.start();
thread2.join(); // thread2.join() ka matlab hai ki main thread (jo ki main method hai) thread2 ke complete hone ka wait karega, uske baad hi thread3 start hoga