1Z0-809 practice question 3 of 25

Given: class Worker extends Thread { CyclicBarrier cb; public Worker(CyclicBarrier cb) { this.cb = cb; } public void run () { try { cb.await()…

Choose your answer, then check it against the explanation.

Given: class Worker extends Thread { CyclicBarrier cb; public Worker(CyclicBarrier cb) { this.cb = cb; } public void run () { try { cb.await(); System.out.println(“Worker…”); } catch (Exception ex) { } } } class Master implements Runnable { //line n1 public void run () { System.out.println(“Master…”); } } and the code fragment: Master master = new Master(); //line n2 Worker worker = new Worker(cb); worker.start(); You have been asked to ensure that the run methods of both the Worker and Master classes are executed. Which modification meets the requirement?
Answer options
Question 3 of 25

Keep practicing

Take the free 1Z0-809 practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other 1Z0-809 practice questions

Scroll to Top