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 |
Why local variables are stored in stack?
Hi friends, i am new to java. can you explain how java is secured.
What an i/o filter?
What's the difference between comparison done by equals method and == operator?
what difference between throw and throws in exception handling.
What is the default value of byte datatype in java?
Explain about serializable interface in java?
Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?
Explain, why the constructor is required in implemented class?
How do generics work in java?
How do you use compareto?
How to display arraylist values in java?