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
What is a method in coding?
Describe what happens when an object is created in java ?
Can we start a thread twice in java?
What is treemap in java?
How to perform merge sort in java?
What is the differences between c++ and java? Explain
How do I print a “?
What are 5 boolean operators?
What is the use of conditional statement?
Which api is provided by java for operations on set of objects?
What does flag mean in java?
What is anonymous inner class?
From the two, which would be easier to write: synchronization code for ten threads or two threads?
How to make a write-only class in java?
List out benefits of object oriented programming language?