<code>
Which of the following statements about threading are true
1) You can only obtain a mutually exclusive lock on methods in a class that extends
Thread or implements runnable
2) You can obtain a mutually exclusive lock on any object
3) A thread can obtain a mutually exclusive lock on a method declared with the keyword synchronized
4) Thread scheduling algorithms are platform dependent
</code>
The answer given are 2,3 and 4.
My first doubt: Answer 2) A thread can obtain a mutually exclusive lock on any object.
I think it can obtain the lock only on those objects whose class contains the synchronized method.
My second doubt: Answer 3) can a thread obtain a mutually exclusive lock on a
method OR should it be
object? If so then should the answer be reworded as " A thread can obtain a mutually exclusive lock on an object when the object invokes a method which has the keyword synchronized".
I have read the JLS on this topic and haven't really got any convincing answer.Does anyone recommend a better source to study threads?