wat is class level lock and object level lock

Answer Posted / ask

Class Lock - If a static method is marked as Synchrnozied
and called by a Thread, the whole Class will be locked
until the method execution completed.

Object Lock - If a non-static method is marked as
Synchronzied and called by a Thread, the current instance
(Object) will be locked util the method execution completed.

Is This Answer Correct ?    53 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we override private constructor in java?

521


Is space a char?

541


What is a private class in java?

514


How to compare two strings in java program?

682


What is a memory leak in java?

553






Why we cannot override static method?

572


Why do we use bufferedreader?

544


What are the drawbacks of reflection?

571


What is the purpose of garbage collection in java?

667


Where is java located?

511


What is private public protected in java?

583


What is a “stateless” protocol ?

568


What does file separator do in java?

547


Why is java so important?

660


What is the constructor?

593