题目内容

class Computation extends Thread { private int num; private boolean isComplete; private int result; public Computation(int num) { this.num = num; } public synchronized void run() { result = num * 2; isComplete = true; notify(); } public synchronized int getResult() { while (!isComplete) { try { wait(); } catch (InterruptedException e) { } } return result; } public static void main(String[] args) { Computation[] computations = new Computation [4]; for (int i = 0; i < computations.length; i++) { computations[i] = new Computation(i); computations[i] .start(); } for (Computation c : computations) System.out.print(c.getResult() +“ “); } } 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 ruin with output “0 2 4 6”.

查看答案
更多问题

起源未明()

A. 耳源性脑脓肿
B. 外伤性脑脓肿
C. 血源性脑脓肿
D. 鼻源性脑脓肿
E. 隐源性脑脓肿

对井下机车运输信号有什么要求?

测量值的精密度高,其准确度也一定高。

A. 正确
B. 错误

简述剪切蒙版、图层蒙版、矢量蒙版的含义。

答案查题题库