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


Please Help Members By Posting Answers For Below Questions

What is the difference between class forname and new?

544


Which methods are used during serialization and deserialization process?

550


What is the difference between an interface and an abstract class?

536


Will set allow duplicates in java?

497


What is java literals?

575






What are reference variables in java?

592


Write a program to find the greatest of three numbers in java?

558


How is it possible for two string objects with identical values not to be equal under the == operator?

523


Why is it called buffering?

582


How many days will it take to learn java?

513


Differentiate between stringbuffer and string?

591


What is the use of runnable interface?

606


what do you mean by classloader?

549


What does sizeof return?

555


What is jvm? Why is java called the platform independent programming language?

541