多选题 Given:
3. public class Stubborn implements Runnable {
4. static Thread t1;
5. static int x = 5;
6. public void run() {
7. if(Thread.currentThread() .getId() == t1.getId()) shove();
8. else push();
9. }
10. static synchronized void push() {shove(); }
11. static void shove() {
12. synchronized (Stubborn. class) {
13. System.out.print(x-- + " ");
14. try {Thread.sleep(2000); } catch (Exception e) { ; }
15. if(x > 0) push();
16. } }
17. public static void main(String[] args) {
18. t1 = new Thread(new Stubborn());
19. t1.start();
20. new Thread(new Stubborn()) .start();
21. } }
Which are true? (Choose all that apply.)
【正确答案】 C
【答案解析】