Hi Friends, I am beginner in java. what i know about
synchonized keyword is,If more that one 1 thread tries to
access a particular resource we can lock the method using
synchronized keyword. Then after that how the lock is
released and how next thread access that.Please explain with
example.
Answers were Sorted based on User's Feedback
Answer / ejp
The lock is released when the holding thread exits the
synchronized block.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / ejp
Throwing the exception exits the synchronized{} block so
that answer doesn't actually add anything.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / ravikiran
The lock will be released & allocation depends on the scheduler
| Is This Answer Correct ? | 0 Yes | 3 No |
when we have to use final class in java?
How can the checkbox class be used to create a radio button?
Is java pass by value or pass by reference?
Can inner class have constructor?
What is charat java?
What is the purpose of a parameter?
How do you escape sequences in java?
What is the constructor?
Why do we need hashmap in java?
What is the base class for error and exception?
Can you extend main method in java?
What is an Iterator interface?