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
What is output buffer?
What is thread start?
Write a function to print Fibonacci series and Tribonacci series?
Explain the difference between serializable and externalizable in java?
What do you mean by stack?
Explain the difference between abstraction and encapsulation.
Which number is denoted by leading zero in java?
What happens if an exception is not handled in a program?
What is a native method in java programming?
What are java threads?
What is the meaning of 3 dots in java?
Explain the difference between abstract class and interface in java?
How we can run a jar file through command prompt in java?
Can I override protected method in java?
Explain creating threads by implementing runnable class?