Given that Triangle implements Runnable, and: Which two statements, inserted independently at both lines 35 and 41, tend to allow both threads totemporarily pause and allow the other thread to execute?()
A.Thread.wait(); B.Thread.join(); C.Thread.yield(); D.Thread.sleep(1); E.Thread.notify();
多项选择题Given: Which three changes should be made to adapt this class to be used safely by multiple threads?()
A.declare reset() using the synchronized keyword B.declare getName() using the synchronized keyword C.declare getCount() using the synchronized keyword D.declare the constructor using the synchronized keyword E.declare increment() using the synchronized keyword
单项选择题Given: What is the result?()
A.Compilation fails. B.An exception is thrown at runtime. C.The code executes and prints "running". D.The code executes and prints "runningrunning". E.The code executes and prints "runningrunningrunning".
单项选择题Given: What is the result?()
A.Compilation fails. B.An exception is thrown at runtime. C.The code executes normally and prints "sleep". D.The code executes normally, but nothing is printed.
A.Afoo Afoo B.Afoo Bfoo C.Bfoo Afoo D.Bfoo Bfoo E.Compilation fails
多项选择题Click the Exhibit button. Which three statements are true?()
A.Compilation fails. B.The code compiles and the output is 2. C.If lines 16, 17 and 18 were removed, compilation would fail. D.If lines 24, 25 and 26 were removed, compilation would fail. E.If lines 16, 17 and 18 were removed, the code would compile and the output would be 2. F.If lines 24, 25 and 26 were removed, the code would compile and the output would be 1.