单项选择题

Given:
3. public class Drip extends Thread {
4. public static void main(String[] args) {
5. Thread t1 = new Thread(new Drip());
6. t1.start();
7. t1.join();
8. for(int i = 0; i < 1000; i++) // Loop #1
9. System.out.print(Thread.currentThread() .getName() + " ");
10. }
11. public void run() {
12. for(int i = 0; i < 1000; i++) // Loop #2
13. System.out.print(Thread.currentThread() .getName() + " ");
14. } }
Which are true (Choose all that apply.)

A.Compilation fails.
B.An exception is thrown at runtime.
C.Loop #1 will run most of its iterations before Loop #2.
D.Loop #2 will run most of its iterations before Loop #1.
E.There is no way to predict which loop will mostly run first.
题目列表

你可能感兴趣的试题

微信扫码免费搜题