wat is class level lock and object level lock
Answer Posted / michael selvan
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.
Note : If we declare as a any static variables or methods
those will be stored in class area. So, if the method is
synchronized static . It'll lock the complete class.
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is the use of StringTokenizer class?
Differentiate between a constructor and a method? Can we mark constructors final?
What is a copy constructor in java?
Is map ordered in java?
If I only change the return type, does the method become overloaded?
Explain naming conventions for packages?
What is the default size of load factor in hashing based collection?
When do I need to use reflection feature in java?
What is the function of http?
5 Coding best practices you learned in java?
List the three steps for creating an object for a class?
Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?
What is the default value of float and double datatype in java?
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
How do listeners work?