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 / 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 |
Is it possible to use string in the switch case?
What is the transient keyword?
Which java collection does not allow null?
How many bits is a 64 bit byte?
List methods available in Java Queue interface
how tha garbage collector know that the object will be deleted? on which algorithm the garbage collector works? what is the working principle of garbage collector? How manay types of garbage collectors r there?
What is concurrent hashmap and its features?
What is the static keyword?
What is method overloading with type promotion?
What do heavy weight components mean in java programming?
Why Java is called as purely platform independent..? Explain briefly..dont Give regular answers Explain with your own example..?
What type of variable is gender?