Given: What is the result?()
A.[1, 2, 3, 5] B.[2, 1, 3, 5] C.[2, 5, 3, 1] D.[5, 3, 2, 1] E.[1, 3, 5, 2]
单项选择题Given: Which statement is true?()
A.Compilation fails because the hashCode method is not overridden. B.A HashSet could contain multiple Person objects with the same name. C.All Person objects will have the same hash code because the hashCode method is not overridden. D.If a HashSet contains more than one Person object with name="Fred", then removing another Person,also with name="Fred", will remove them all.
多项选择题WhichtwocodefragmentswillexecutethemethoddoStuff()inaseparatethread?()
A.new Thread() {public void run() { doStuff(); }}; B.new Thread() {public void start() { doStuff(); }}; C.new Thread() {public void start() { doStuff(); }}.run(); D.new Thread() {public void run() { doStuff(); }}.start(); E.new Thread(new Runnable() {public void run() { doStuff(); }}).start();
单项选择题Click the Exhibit button. What is the result?()
A.The code will deadlock. B.The code may run with no output. C.An exception is thrown at runtime. D.The code may run with output "0 6". E.The code may run with output "2 0 6 4". F.The code may run with output "0 2 4 6".
多项选择题Given: Which two statements are true?()
A.The output could be 8-1 7-2 8-2 7-1 B.The output could be 7-1 7-2 8-1 6-1 C.The output could be 8-1 7-1 7-2 8-2 D.The output could be 8-1 8-2 7-1 7-2
单项选择题Given: foo and bar are public references available to many other threads. foo refers to a Thread and bar is anObject. The thread foo is currently executing bar.wait(). From another thread,what provides the most reliable wayto ensure that foo will stop executing wait()?
A.foo.notify(); B.bar.notify(); C.foo.notifyAll(); D.Thread.notify(); E.bar.notifyAll();