Question: Report the deterministic output or all possible outputs that can be generated by the program HW_1_2_SP19 reported below. Justify your answer, by describing your motivations

 Report the deterministic output or all possible outputs that can be
generated by the program "HW_1_2_SP19" reported below. Justify your answer, by describing

Report the deterministic output or all possible outputs that can be generated by the program "HW_1_2_SP19" reported below. Justify your answer, by describing your motivations in terms of multi-threading issues. You can also show a thread diagram. 3 public class HW_1_2_SP19 { 5 private static int x - ; public static void main(String[] args) throws InterruptedException { MyThread ti - new MyThread("t1"); MyThread t2 - new MyThread("t2"); method10; t1.start(); t1.join(; method2O; t2.start(); t2.join(); method10: } //main public static void method1() { X++; Thread t1 - Thread.currentThreado; System.out.println("X" + x + " Name=" + t1, getName() + " State-" + t1.getState(); }//method1 public static void method2() { Thread t2 = Thread.currentThreado; System.out.println("X-" + x + " Name=" + t2.getName() + " State" + t2.getState(): SEX ++; }//method2 31 }//HW_1_2_5P19 33 class MyThread extends Thread { 34 int x; 35 public MyThread(String Name) { 36 setName(Name); }//constructor 39 public void run() { System.out.println("X- X++ }//run 43 }//My Thread + getName() + " State-" + getState()

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!