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
How many times finalize method will be invoked? Who invokes finalize() method in java?
What is local class in java?
How do you do descending order in java?
Explain about main() method in java ?
What is advantage of java?
Why wait and notify methods are declared in object class?
what is an objects lock and which objects have locks? : Java thread
how to create daemon thread in java?
What is the null?
which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?
Is zero a natural number?
Can we extend private class in java?
What are singleton services?
How do you override a private method in java?
What is instance means in java?