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



Hi Friends, I am beginner in java. what i know about synchonized keyword is,If more that one 1 thre..

Answer / ejp

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

Is This Answer Correct ?    3 Yes 0 No

Hi Friends, I am beginner in java. what i know about synchonized keyword is,If more that one 1 thre..

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

Hi Friends, I am beginner in java. what i know about synchonized keyword is,If more that one 1 thre..

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

Hi Friends, I am beginner in java. what i know about synchonized keyword is,If more that one 1 thre..

Answer / jitu

ok i agree with u ejp

wat abt this ??

thread invokes wait() method..

is holding remains in synchronized block or it exists.

Is This Answer Correct ?    0 Yes 0 No

Hi Friends, I am beginner in java. what i know about synchonized keyword is,If more that one 1 thre..

Answer / ravikiran

The lock will be released & allocation depends on the scheduler

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Core Java Interview Questions

What is an object in java and how is it created?

0 Answers  


Can we increase array size dynamically in java?

0 Answers  


What do you mean by Function Overloading in java?

0 Answers   Impetus,


explain System.out.println()

12 Answers   CTS,


what type of questions asked for barclays technologies pune please send urgent

0 Answers  






What is the difference between throw and throws in java?

0 Answers  


What does file separator do in java?

0 Answers  


What are assembly attributes?

0 Answers  


What is java util concurrentmodificationexception?

0 Answers  


Hey buddy.. can you please tell me about the use of marker interface? And is there any link between marker interface and factory methods? Thanks in advance.

2 Answers  


In a my eclipse editor if i want to switch from jdk 1.4 to jdk 1.6 how to do that???? Initially i have jdk1.4

1 Answers   Tech Mahindra,


What is method in research paper?

0 Answers  


Categories