자격증/OCJP_ExamC
QUESTION 20
IT grow.
2018. 7. 24. 01:13
반응형
QUESTION 20Given:public class PingPong implements Runnable{synchronized void hit(long n){for (int i = 1; i < 3; i++)System.out.print(n + "-" + i + " ");}public static void main(String[] args) {new Thread(new PingPong()).start();new Thread(new PingPong()).start();}public void run() {hit(Thread.currentThread().getId());}}Which two statements are true? (Choose two.)A. The output could be 8-1 7-2 8-2 7-1B. The output could be 7-1 7-2 8-1 6-1C. The output could be 8-1 7-1 7-2 8-2D. The output could be 8-1 8-2 7-1 7-2Solution : CD
반응형