Question
Which statement is true?
Answer: Option B
Was this answer helpful ?
B is correct because multiple threads are allowed to enter nonsynchronized code, even within
a class that has some synchronized methods.
A is incorrect because static methods can be synchronized; they synchronize on the lock on
the instance of class java.lang.Class that represents the class type.
C is incorrect because only methodsâ€â€not variablesâ€â€can be marked synchronized.
D is incorrect because a sleeping thread still maintains its locks.
Was this answer helpful ?
Submit Solution