Java SE 6 Programmer Certified Professional (1Z0-851)

© examsiri.com
Question : 6 of 10
 
Marks: +1, -0
Given:
5. public class Lockdown implements Runnable {
6. public static void main(String[] args) {
7. new Thread(new Lockdown())start();
8. new Thread(new Lockdown())start();
9. }
10. public void run() { locked(Thread.currentThread()getId()); }
11. synchronized void locked(long id) {
12. System.out.print(id + "a ");
13. System.out.print(id + "b ");
14. }
15. }

What is true about possible sets of output from this code?
Go to Question: