Java Programming - Threads - Discussion
Discussion Forum : Threads - Pointing out the correct statements (Q.No. 1)
1.
Which statement is true?
Answer: Option
Explanation:
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.
Discussion:
1 comments Page 1 of 1.
Puneet bagewdi said:
1 decade ago
Does a thread releases its lock when wait() is called on it ?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers