Hi,
I've encountered a question on certpal.com site at the exam from all topics no. 3 for
Java 6. The question number is 34.
Here's the code snippet:
They say that the correct answer is the first one: the fact that the output is guarenteed to be 4444.
But, when running the above code it seems like deadlock is an usual issue. In my opinion, this happens because the Main
thread acquires a lock for one of the 4 objects(let's say A) and then the A thread can't call its run() method since the lock is taken away by Main.
I'd rather go for "The ouput is not guarenteed".
What do you think?