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 void a wrapper class?
What is an infinite loop?
Is there any tag in htm to upload and download files?
How big is a 32 bit integer?
What is java abstraction with example?
What do you understand by overloading and overriding in java?
What value is a variable of the string type automatically initialized?
What are the pillars of java?
java is pure object-oriented programming language?why it is platform independent.
Can Exception handling we can handle multiple catch blocks?
What is the difference between the continue and break statement?
all are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined classes and we can extend atmost one class so each class can extend more than one class so java supports multiple inheritance?i am confused with this,pls any one explain me.