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 package protected in java?
What means public static?
What is the maximum size of array in java?
can we access the super class method using subclass object?
What is method overloading in java ?
What is a stringbuffer?
How to access a method that it declared as protected?
What is a return in java?
What is a map in java?
How to set the permissions to a file in java?
How can an object be unreferenced?
In Inheritance if we are implementing Multi level inheritance and all class having same name of variable and now i want to access each class variable and how it is possible?