Oracle
1Z0-851 · Question #70
1Z0-851 Question #70: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #70. The question stem and answer options stay visible for context.
Question
Given: 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.)
Options
- AThe output could be 8-1 7-2 8-2 7-1
- BThe output could be 7-1 7-2 8-1 6-1
- CThe output could be 8-1 7-1 7-2 8-2
- DThe output could be 8-1 8-2 7-1 7-2
Unlock 1Z0-851 to see the answer
You've previewed enough free 1Z0-851 questions. Unlock 1Z0-851 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.