多项选择题
Which three will compile and run without exception?()
A.private synchronized Object o;
B.void go() {synchronized() { /* code here */ }
C.public synchronized void go() { /* code here */ }
D.private synchronized(this) void go() { /* code here */ }
E.void go() {synchronized(Object.class) { /* code here */ }
F.void go() {Object o = new Object();synchronized(o) { /* code here */ }
相关考题
-
单项选择题
Given: What can be a result?()
A.Compilation fails.
B.An exception is thrown at runtime.
C.The code executes and prints "StartedComplete".
D.The code executes and prints "StartedComplete0123".
E.The code executes and prints "Started0123Complete". -
单项选择题
Given: What, inserted at line 39, will sort the keys in the props HashMap?()
A.Arrays.sort(s);
B.s = new TreeSet(s);
C.Collections.sort(s);
D.s = new SortedSet(s); -
单项选择题
Given: What is the result?()
A.2 -1
B.2 -4
C.2 -5
D.3 -1
E.3 -4
