Which modification meets the requirement?

Given:


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?
A. At line n2, insert CyclicBarrier cb = new CyclicBarrier(2, master);
B. Replace line n1 with class Master extends Thread {
C. At line n2, insert CyclicBarrier cb = new CyclicBarrier(1, master);
D. At line n2, insert CyclicBarrier cb = new CyclicBarrier(master);

Download Printable PDF. VALID exam to help you PASS.

4 thoughts on “Which modification meets the requirement?

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.