Hi Friends, I am new 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) in thread.
Answer Posted / ravikiran
Thread is a sequential flow of control
With the help of wait(),notify(),notifyAll() methods from
the Object class
We can force a thread to be locked by making the object to
be synchronized or putting the code inside a synchronized block
We will got to know the unlocking status with the help of
notify / notifyAll method calls.
Method level block will provide a lock for the whole method
access.Block level lock will lead to a particular portion of
a program to be get locked.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
List the features of java programming language.
Can we inherit inner class?
Is set thread safe java?
Explain about automatic type conversion in java?
How do you identify if jvm is 32-bit or 64-bit from java program?
Is 0 an irrational number?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?
Which class is the superclass for every class in java programming?
What is abstract class constructor called?
Are global variables initialized to zero?
Why javac is not recognized?
Why charat is used in java?
What is method overloading in JAVA? Why is it not present in C ?
What does \ mean in regex?
What is the collections api?