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.



Hi Friends, I am new to java. Can u explain about thread concept.How i know one thread is locked, a..

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

Post New Answer

More Core Java Interview Questions

What are the java ide’s?

0 Answers  


What is the map interface in java programming?

0 Answers  


What is Java Annotations?

0 Answers  


what is the Use of throws exception?

2 Answers  


Can you override static method in java?

1 Answers  






What are the two major components of JDBC?

5 Answers   CMC, Mind Tree,


Is 9 a prime number?

0 Answers  


What does snprintf return?

0 Answers  


What are the java ide's? Explain

0 Answers  


what is overloading in java?

13 Answers   Ascent, DNS, Infosys, SDA, VelTech,


How do you empty a list in java?

0 Answers  


Is array serializable java?

0 Answers  


Categories