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

How do you define a method?

509


How thread scheduler schedule the task?

584


Detail discussions on JVM, memory management and garbage collector.

550


What access modifiers can be used for variables?

581


What do you understand by abstract classes?

600






What is intern method in java?

580


Explain the use of javap tool.

631


Explain exception chaining in java?

607


What is the use of jtable?

650


How do you make an arraylist empty in java?

475


Can we store variables in local blocks?

783


What is use of static method?

532


What is use of valueof () in java?

555


Is age discrete or continuous?

684


What is the difference between a method and a procedure?

546