ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
Life Cycle of Thread
 Question Submitted By :: Tathagata
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Life Cycle of Thread
Answer
# 1
A Thread has the following life cycles states
1.New/Born state:When a thread is just instantiated we say 
that the thread is in born state.now it can not compete for 
CPU cycles.
2.Active state:When we call the start() on thread object a 
thread moves from born state to active state.Here the code 
associated with run() will be executed.
3.Blocked state:When the thread is temporarily keep out of 
ready queue,we say that the thread is in blocked state. In 
this state it can't compete for CPU cycles.
4.Dead state:When the thread execution is completed or 
forcibly terminate the thread, it will be moved to dead 
state.
 
Is This Answer Correct ?    4 Yes 1 No
Gajendra
 
  Re: Life Cycle of Thread
Answer
# 2
When an object is created using Thread class,it is in the 
new state, when the start method is called the object goes 
into the runnable state from where the scheduler picks up 
and starts executing. If that process requires any resource 
it is picked and put to the blocked state and when the 
process finished that thread is in dead state.
states:
1 new
2 runnable
3 running
4 blocked
5 dead
 
Is This Answer Correct ?    6 Yes 1 No
Guru
 
 
 
  Re: Life Cycle of Thread
Answer
# 3
1.ActiveState
2.RunnableState
3.RunningState
4.Blocked State
5.Dead State

These are the Thread Life Cycle States
 
Is This Answer Correct ?    0 Yes 1 No
Deepak Divvela
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
what is the output ? Math.floor(-2.1) a)2 b)-2 c)-3.0 d)0 Accenture2
public class AboutStrings{ public static void main(String args[]){ String s1="hello"; String s2="hel"; String s3="lo"; String s4=s2+s3; //to know the hash codes of s1,s4. System.out.println(s1.hashCode()); System.out.println(s4.hashCode()); // these two s1 and s4 are having same hashcodes. if(s1==s4){ System.out.println("s1 and s4 are same."); }else System.out.println("s1 and s4 are not same."); } } Somebody told me that, == operator compares references of the objects. In the above example even though s1 and s4 are refering to same object(having same hash codes), it is printing s1 and s4 are not same. Can anybody explain in detail why it is behaving like this? Thanks in Advance RavuriVinod TCS3
why applet doesn't have main? isn't possible a program with out main?  5
transaction attributes ?  2
Howmany address lines are required to addressing 1 MB memory?  3
How are commas used in the initialization and iteration parts of a for statement?  2
Explain the difference between scrollbar and scrollpane?  1
Can an object?s finalize() method be invoked while it is reachable?  2
How to declare unique ArrayList ? RMSI4
1).Is Object class abstract or not? 2).Is main method(public static void main(String args[])low priority thread or high priority thread? TCS2
What is meant by Java interpreter?  2
What is the specification of ?CODEBASE? in an applet?  1
Difference between array and arraylist. Sai-Softech4
what is polymorphism with example?types of polymorphism? HP6
Why do we use public static with the main function in Java? Infosys7
what is the purpose of class "Object" which is base class for all classes?  3
What is method Overriding in the perspective of OOPS?  2
Can a double value be cast to a byte?  3
Without creating a new object, How you can retrieve a String or other object?  1
what is the form of storage space in java?  5
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com