多选题 Given:
4. public class Stone implements Runnable {
5. static int id = i;
6. public void run() {
7. try {
8. id = 1 - id;
9. if(id == 0) {pick(); } else {release(); }
10. } catch (Exception e) { }
11. }
12. private static synchronized void pick() throws Exception {
13. System.out.print ("P "); System.out.print("Q ");
14. }
15. private synchronized void release() throws Exception {
16. System.out.print("R "); System.out.print("S ");
17. }
18. public static void main(String[] args) {
19. Stone st = new Stone();
20. new Thread(st) .start();
21. new Thread(st) .start();
22. } }
Which are true? (Choose all that apply.)
【正确答案】 A、B、C
【答案解析】