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

单选题:Given code below:

Luz5年前 (2021-05-10)题库1123
Given code below:
```Java
class RunTest implements Runnable{
public static void main(String[] arg) {
RunTest rt = new RunTest();
Thread t = new Thread(rt);
// here
}
public void run() {
while ( true )
System.out.println("running");
}
void go() { start(1); }
void start(int i) {}
}
```
Put which statement below at //here is able to print running endlessly?
@[B](2)

A. `System.out.println("running");`
B. `t.start();`
C. `rt.go();`
D. `rt.start(1);`




A.`System.out.println("running");`
B.`t.start();`
C.`rt.go();`
D.`rt.start(1);`


答案:B