多项选择题
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. -
单项选择题
Given: What is the result?()
A.Afoo Afoo
B.Afoo Bfoo
C.Bfoo Afoo
D.Bfoo Bfoo
E.Compilation fails
