Question # 42 from Marcus Green
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
Ans : I believe 2 and 4 are right answers. But 3 is also given as right answer. How can a thread obtain a lock on a "method". Isn't is supposed to get lock on object of the method?
Any help is greatly appreciated.