Java pleaseignore all the attempts in inkQuestion 3: Complete the Java code below, using wait() / notify appropriately, so that the correct total is printed ie, after the count is done. (6 marks) public class Test public static void main(String[] args) { TotalRunr = new TotalRun(); Thread t = new Thread(); t.start(): while coon gevretmek N tunc = t.to/Etontt; Amber Badesky Puts Deursen t-get insture notty(); } ) Synchronical Ctir System.out.println(“Total is: ” + t.total): featch (latempted -+-, Summonizeal Lithiste -class TotalRun implements Runnable int n = 0, total = 0; @Override public void run() { try & while Coc total) & wait (0,2 Thread.sleep (200); } while (n<1000 ) {total += n++) Tuttede schone xgx; UM 3 TOROS le patients catch (Intermobel Prepinize) Show transcribed image text Question 3: Complete the Java code below, using wait() / notify appropriately, so that the correct total is printed ie, after the count is done. (6 marks) public class Test public static void main(String[] args) { TotalRunr = new TotalRun(); Thread t = new Thread(); t.start(): while coon gevretmek N tunc = t.to/Etontt; Amber Badesky Puts Deursen t-get insture notty(); } ) Synchronical Ctir System.out.println(“Total is: ” + t.total): featch (latempted -+-, Summonizeal Lithiste -class TotalRun implements Runnable int n = 0, total = 0; @Override public void run() { try & while Coc total) & wait (0,2 Thread.sleep (200); } while (n
Expert Answer
Answer to Question 3: Complete the Java code below, using wait() / notify appropriately, so that the correct total is printed ie, …