Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 is early binding and late binding in java?

0 Answers  


Can a class extend 2 classes in java?

0 Answers  


Why can't we make jsp as a controller and action servlet in struts?

8 Answers   TCS, Wipro,


What are the allowed, non-Unicode letter characters that can be used as the first character of an identifier?

2 Answers  


Why is stringbuffer called mutable?

0 Answers  


What is the tradeoff between using an unordered array versus an ordered array?

0 Answers  


What is the meaning of I ++ in java?

0 Answers  


Every class extends object but why it is not possible for every object to invoke clone() method. ideally protected methods should be accessible from sub classes. isn't it?

2 Answers  


What is command line argument

0 Answers   TCS,


what are three ways in which a thread can enter the waiting state? Or what are different ways in which a thread can enter the waiting state? : Java thread

0 Answers  


Explain the polymorphism principle?

0 Answers  


what is main difference b/w abstract class and interface

4 Answers  


Categories