-->
当前位置:首页 > 题库

单选题:Given code below:

Luz5年前 (2021-05-10)题库1406
Given code below:
```Java
Thread t = new Thread() {
void run() {
for (;;) System.out.println();
}
};
t.start();
t.sleep(1000);
```
Which statement below is correct? @[B](2)

A. Thread t will sleep for at least one second at the last line.
B. The current thread, which executes the last line, will sleep for at least one second.
C. The last line has no chance to be executed.
D. None of the above.



A.Thread t will sleep for at least one second at the last line.
B.The current thread, which executes the last line, will sleep for at least one second.
C.The last line has no chance to be executed.
D.None of the above.


答案:B