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 |
What is bean? Where it can be used?
Explain about static nested classes in java?
Explain exception chaining in java?
Can you make an instance of an abstract class?
What is merge sort in java?
Is void a return type?
Describe method overriding
What is string args [] in java?
What is the difference between array and array list in java?
whats the diff between jsp and servlets?
How many bytes is a string in java?
Does java support multiple inheritance or not?