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
Can we override private constructor in java?
Is space a char?
What is a private class in java?
How to compare two strings in java program?
What is a memory leak in java?
Why we cannot override static method?
Why do we use bufferedreader?
What are the drawbacks of reflection?
What is the purpose of garbage collection in java?
Where is java located?
What is private public protected in java?
What is a “stateless” protocol ?
What does file separator do in java?
Why is java so important?
What is the constructor?