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...

What is the life cycle of Thread ?

Answer Posted / sasikala d

1. New state - After the creations of Thread instance
the thread is in this state but before the start() method
invocation. At this point, the thread is considered not
alive.
2. Runnable (Ready-to-run) state - A thread start its
life from Runnable state. A thread first enters runnable
state after the invoking of start() method but a thread can
return to this state after either running, waiting,
sleeping or coming back from blocked state also. On this
state a thread is waiting for a turn on processor.
3. Running state - A thread is in running state that
means the thread is currently executing. There are several
ways to enter in Runnable state but there is only one way
to enter in Running state: the scheduler select a thread
from runnable pool.
4. Dead state - A thread can be considered dead when
its run() method completes. If any thread comes on this
state that means it cannot ever run again.
5. Blocked - A thread can enter in this state because
of waiting the resources that are hold by another thread.

Is This Answer Correct ?    16 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is join () in java?

907


What is equlas() and hashcode() contract in java? Where does it used?

1052


Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain

1863


Define nashorn in java8.

971


Write a program to print all permutations of string?

1065


Explain restrictions for using anonymous inner classes?

1036


What is try-with-resources in java?

1101


Is it necessary that each try block must be followed by a catch block?

971


Does java vector allow null?

895


what state does a thread enter when it terminates its processing? : Java thread

990


Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?

968


How to perform binary search in java?

945


What is an object’s lock and which object’s have locks?

890


What is string value?

1088


Can we have try block without catch block?

985