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 / jitu

The lock is released when the holding thread exits the
synchronized block or an exception is occurred in execution.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a parameter used for?

513


What are 3 boolean operators?

533


What is better - 'bit-shift a value' or 'multiply by 2'?

698


how to one war file class to another war file class?

1552


What does @param args mean in java?

550






Is void a keyword in java?

592


Which is faster string or stringbuilder?

517


What is java object name?

549


What is the difference between array and array list in java?

606


What kind of variables can a class consist?

583


What is the difference between serial and throughput garbage collector?

579


How can you handle java exceptions?

527


What is data type example?

548


What is a condition in java?

535


What is the difference between break and continue statements?

547