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
Why Java doesn’t support multiple inheritance?
Which is the best approach for creating thread ?
What are thread local variables?
What is the difference between heap and stack memory?
What is the difference between import java.util.date and java .util?
How do you convert bytes to character in java?
explain copyonwritearraylist and when do we use copyonwritearraylist?
Are arrays classes in java?
Difference between object and reference?
I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?
Is java hashset ordered?
What is the inheritance?
Why is whitespace important?
What is complexity in java?
How do you pass by reference?