samar
Java object's lock
1 Answer(s)      4 years and 7 months ago
Posted in : Java Interview Questions
What is an object's lock and which object's have locks?
Advertisement
View Answers

October 27, 2010 at 12:10 PM


Hi,

Here is the answer.

An object's lock is a mechanism that is used by multiple threads to obtain synchronizedaccess to the object. A thread may execute a synchronized method of an object only afterit has acquired the object's lock. All objects and classes have locks. A class's lock isacquired on the class's Class object.

Thanks.










Related Tutorials/Questions & Answers:
Java object's lock
Java object's lock  What is an object's lock and which object's have locks
Java lock
Java lock  Can a lock be acquired on a class
Advertisements
Java lock
Java lock  Can a lock be acquired on a class
What is an object's lock and which object's have locks?
What is an object's lock and which object's have locks?   Hi, What is an object's lock and which object's have locks? Thanks
Java thread lock
Java thread lock  What happens when a thread cannot acquire a lock on an object
Java lock file or folder.
Java lock file or folder.  Is it possible to create a desktop application to lock or encrypt file or folder in windows by using java code?? if possible can provide some reference?? because i can't find it... thanks
Java file lock
Java file lock In this section, you will learn how to lock a file... by using the New I/O API (nio). Java provides lock and tryLock() methods in FileChannel class for getting a lock over the file object. In the given program
lock on a class
lock on a class  hello, Can a lock be acquired on a class?   hiii,, Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object
How to make one waiting thread for lock - Java Beginners
to java. Can u explain about thread concept.How i know one thread is locked, and how can i force or acquire another thread for lock . Finally how to know thread is released from lock. Explain types of lock(like method level and block level
difference between lock and synchronization
difference between lock and synchronization  Hi, I am new in java please anyone tell me difference between lock and synchronization in java. its urgent. Thank in advance   Please visit the following link: Lock
Java object
Java object  Which class should you use to obtain design information about an object
Java object
Java object  What is mutable object and immutable object?  An Immutable object is a kind of object whose state cannot be modified after it is created. This is as opposed to a mutable object, which can be modified
JAVA Method Wait
JAVA Method Wait       The Wait method in Java hold the thread to release the lock till the thread hold the object. The most important point is to be remember that wait method
Java Thread HoldsLock
Java Thread HoldsLock In this tutorial, you will learn how to lock a thread with example in Java. Thread HoldsLock  : It is easy to use... :  In this example we are using Thread.holdsLock to lock the object
Object in java - Java Beginners
Object in java  Hi deepak, I am new to java, can u tell me what is class ,object and instance with example. For example : class raja , raja r.../java/master-java/java-object-oriented-language.shtml http
Java object clone
Java object clone  What is criteria for a object to get cloned
java object - Java Beginners
java object  i want a complete memory description of objects,methods... of objects. The primitive data type and keyword void is work as a class object. Object: Object is the basic entity of object oriented programming language
java object - Java Beginners
java object  i want to where in the memory the java objects,local... are stayed  Hi friend, Instance Variables (Non-static fields): In object... fields" that is declared without the static keyword. Each object of the class has its
java object class methods
java object class methods  What are the methods in Object class?  There are lots of methods in object class. the list of some methods are as- clone equals wait finalize getClass hashCode notify notifyAll
Map java Object to database.
Map java Object to database.  How do you map Java Objects with Database tables
java is pure object oriented
java is pure object oriented  java is pure object oriented or not.? reason.?   Java is not pure object oriented language because... are not object 2)It does not support operator overloading multiple inheritance. 3
object conversion - Java Beginners
object conversion   Hi, Can anybody tell me the object conversion in java.   Hi sandeep Can u please tell me in details about your query, otherwise u may got help from here, http://www.roseindia.net/java
Object class in java
Object class in java  want an example and with an explaination about equals() method in object class? Is equals() is similar
object creation - Java Beginners
object creation  I need object creation in depth(with stack,pc registers).Any one can provide me if possible with video/audio
java : object oriented
java : object oriented   (a) Write a class named CarRental... the user for the data needed for a rental and creates an object of the correct... an object of the correct type. Display the total rental fee
vector object - Java Beginners
vector object  hi i have created a Vector vec=new Vector(); vec.addElement(o); o is an object of group(acl.group) what i have to do to read contents of this object? can it be possible to convert it into string arrays
Object serialization - Java Beginners
Object serialization  Design classes for Currency, Rupee, and Dollar. Write a program that randomly generates Rupee and Dollar objects and write them into a file using object serialization. Write another program to read
object - Java Interview Questions
?   Hello, i know only two wayes of object instansiations 1.... Thankx   Hi Friend, Yes we can create an object in the following... of creating an object. ClassName classObject = new ClassName(); 2. Using
Java Object
Java Object      ... properties of the class or its group. Java object is an instance of the class. It takes.../java-object-oriented-language.shtml  
Is Java a pure object oriented language?
Is Java a pure object oriented language?   Hi, Is Java a pure object oriented language? thanks   Hi No, Java is an object oriented programming language but not purely a object oriented language. In OOPs programming
Deserializing an Object in java
Deserializing an Object in java     .... The given program shows how to read any data or contents from the serialized object or file. It takes a file name and then converts into java object. If any exception