Java object's lock

Java object's lock

What is an object's lock and which object's have locks?
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
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
Advertisements
Java object
Java object  Which class should you use to obtain design information about an object
Java lock
Java lock  Can a lock be acquired on a class
Java lock
Java lock  Can a lock be acquired on a class
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 thread lock
Java thread lock  What happens when a thread cannot acquire a lock on an object
Java object clone
Java object clone  What is criteria for a object to get cloned
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
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
Is Java object oriented?
Is Java object oriented?  Hi, Is Java object oriented? Thanks   Hi, Java is object oriented programming language. It is supports OPPS concepts: Object Class Inheritance Polymorphism Abstraction Encapsulation All
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
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
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
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 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 : 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
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
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 - 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/master-java/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
object
object  is it possible to create object in the same class..?.   Yes, you can. class CreateObject { CreateObject(){ System.out.println("I have an object."); } public static void main(String[] args
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
Serializing an Object in Java
Serializing an Object in Java   ... of object i.e. reused by the JVM (Java Virtual Machine). This process... of saving an object in a storage medium (such as a file, or a memory buffer
object retun type - Java Beginners
object retun type  Hi, i have to create a method which should have return type of object . The object should contain 'list of filenames' array and a boolean field 'isVal'. Can anybody help
object 2 string - Java Beginners
object 2 string  hi sir,how to convert object to string and how 2 compare object with null value to string with null value plz provide a program 4 this sir,plzzzzzzzzz
What are the methods in Object? - Java Beginners
What are the methods in Object?   Hi, What are the methods in Object? Give example of methods in Object. Thanks   Hello, There are lot of method in object class some of are as follows toString(); wait
Creating Java Object in Vbscript - Development process
Creating Java Object in Vbscript  How to create a java object in Vbscript. Please give the detailed steps to create a java Object in Vbscript
In Java how to get size of class and object?
In Java how to get size of class and object?  In Java how to get size of class and object
In Java how to get size of class and object?
In Java how to get size of class and object?  In Java how to get size of class and object
what is mutable and immutable object in java ?difference ?
what is mutable and immutable object in java ?difference ?  what is mutable and immutable object in java ?difference
Difference between object and instance? - Java Beginners
Difference between object and instance?  What is the difference between object and instance in java
object oriented programming - Java Beginners
object oriented programming  sir, i read in the book tat object oriented program exhibits recurring structures. i want to know "what is meant by recurring structures?"  Hi Friend, Any structure to be occurred over
ResultSet object initialization - Java Beginners
ResultSet object initialization  How to initialize resultset object  Hi friend, public interface ResultSet A ResultSet object maintains a cursor pointing to its current row of data. A default ResultSet object
OBJECT CLASS - Java Interview Questions
OBJECT CLASS  How To Find Out How many Objects Create?How Many Object Are Reachabule To Garbage Collector?i want Source code Plz Help me........?urgentttttttttttttt  To find the number of objects created
String and stringbuffer object - Java Beginners
String and stringbuffer object  Hi, What is the basic difference between string and stringbuffer object? Thanks   Hi Friend, Differences: 1)String class is used to manipulate character strings that cannot
lock on a class
lock on a class  hello, Can a lock be acquired on a class?   hiii,,ADS_TO_REPLACE_1 Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object
Object-Oriented programming - Java Beginners
Object-Oriented programming  Write a program to display the names and salaries of 5 employees.Make use of a class and an array.The salary of each employee should increase by 5% and displayed back.  Hi friend, Code
Java I/O Object Streams
Java I/O Object Streams In this section we will discuss the Java IO Object Streams. To work with the I/O of objects Java provided the support of Object stream. Object stream classes implements either ObjectInput or the ObjectOutput
Object oriented program - Java Beginners
Object oriented program  Write a class called RaceCar.java that contains instance variables horsepower, weight, zeroTo60, and milesPerGal. The value of zeroTo60 (in second) is determined by the formula zeroTo60 = weight
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
object oriented program.. - Java Beginners
object oriented program..  Write a class called RaceCar.java that contains instance variables horsepower, weight, zeroTo60, and milesPerGal. The value of zeroTo60 (in second) is determined by the formula zeroTo60 = weight
Accessing the object information - Java Beginners
Accessing the object information  Authors.java import java.util.*; import jsns.model.AbstractAgent; import jsns.model.IAgentActor; import jsns.model.IAgentSensor; import jsns.model.IEnvironment; import
Reference type Vs Object type. - Java Beginners
. They never contain the object. C++ object variables may be either, but Java supports only object references. For Example : Book bookvar = new Book("Java...Reference type Vs Object type.  Can anyone explain the exact
About Object cloning. - Java Interview Questions
About Object cloning.  what is Object cloning? can u explain with example?  Hi Friend, The way to make an identical copy of an object is said to be object cloning.In java, it has to be done using clone() method
fully object oriented language - Java Beginners
fully object oriented language  Is java is a fully object oriented language?if no,why?  Hi Friend, Java is not a fully object oriented... int,float which are not object 2)It does not support operator overloading

Ads