Question: Notice the following code . Assume the MyRunnable ( ) is a class extending the Runnable interface. What's the purpose of the highlighted code? public

Notice the following code . Assume the MyRunnable() is a class extending the Runnable interface. What's the purpose of the highlighted code? public static void main(String[] args){ Thread t1= new Thread(new MyRunnable(),"t1"); Thread t2= new Thread(new MyRunnable(),"t2"); Thread t3= new Thread(new MyRunnable(),"t3"); t1.start(); t2.start(); try { t1.join(); t2.join(); } catch (InterruptedException e){ e.printStackTrace(); } t3.start(); }. Forces program to wait until threads t1 & t2 are complete before starting t3. Forces program to wait until thread t1 is complete before starting t2. Threads t1 and t2 are potentially running concurrently Thread t2 isnt started until thread t1 is complete

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!