Can we call the Thread.sleep in Synchyronozed block?
Answer Posted / muthusenthil
yes, you can call wait method inside synchronized block but
synchronized block usually allows one by one to penetrate
in.if you call wait method inside it will create a stagnant
circumstance. synchronized block wont allow other threads
inside till this thread in waiting state get notified
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Can private method static?
Assume a thread has lock on it, calling sleep() method on that thread will release the lock?
Where is core java used?
What is a protected method?
What is the this keyword?
What is the use of parseint in java?
Explain notify() method of object class ?
What is a top level class in java?
What is tree in java?
Can we increase size of array?
Can we call the constructor of a class more than once for an object?
How does thread synchronization occurs inside a monitor?
What is the platform?
What data structures are used to perform recursion?
What access modifiers can be used for class ?