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 synchronized method of an object
4) Thread scheduling algorithms are platform dependent
Option 2,3,4 are given true. Regarding option 2, we can obtain mutually exclusive lock only on objects/class which has synchronized code, right? Can anyone explain this?
Another question:
Which of the following statements are true?
1) Adding more classes via import statements will cause a performance overhead, only import classes you actually use.
2) Under no circumstances can a class be defined with the private modifier
3) A inner class may under some circumstances be defined with the protected modifier
4) An interface cannot be instantiated
3,4 are given true. Option 2 is not given true. A class can't be defined private, right? Why this option is not true?
[This message has been edited by Alamu Vinai (edited March 21, 2001).]