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.

Answer Posted / ejp

The lock is released when the holding thread exits the
synchronized block.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an error in java?

635


Can we access the non-final local variable, inside the local inner class?

511


Why you should not use singleton?

536


What is the main function in java?

525


How do you sort an array in java?

535






why using interface interface ?

1501


What is the difference between yielding and sleeping?

551


Why volatile is used in java?

526


What are filterstreams?

604


Is java a utf 8 string?

524


What is http client in java?

515


Difference difference paint() and paintcomponent()?

528


Why string is immutable or final in java

604


Does sprintf add a null terminator?

556


What is the synonym of procedure?

528