| Author |
Doubt on Thread state
|
Ashok Pradhan
Ranch Hand
Joined: Dec 17, 2007
Posts: 179
|
|
I want know when a thread is said to be in running state.the follawing program prints "RUNNABLE" 10 times.But how can I get "RUNNING" by getState().
|
 |
Daniel Del Moral
Ranch Hand
Joined: May 24, 2008
Posts: 32
|
|
Check the API: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.State.html There is no RUNNING state in the class Thread.State. That might be because it doesn't make sense to add this state. Think about it, if getState() is been executed, then you are running the Thread. If you make a difference in the Thread.State between running and runnable, you won't ever print runnable, because it would mean you're not executing it right now.
|
SCJP 5, SCWCD 5
|
 |
Ashok Pradhan
Ranch Hand
Joined: Dec 17, 2007
Posts: 179
|
|
thanks Daniel for Excellent !!! explanation, now I got it. I am preparing for SCJP 6 and you have great score on SCJP(97%) ,so would you send your study notes and materials when you are preparing for the SCJP and Thanks... waiting.....
|
 |
Ashok Pradhan
Ranch Hand
Joined: Dec 17, 2007
Posts: 179
|
|
|
SORRY!!! i am forgotting my e-mail ID-ashokpradhan_61@yahoo.com
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6588
|
|
Originally posted by Ashok Pradhan: thanks Daniel for Excellent !!! explanation, now I got it. I am preparing for SCJP 6 and you have great score on SCJP(97%) ,so would you send your study notes and materials when you are preparing for the SCJP and Thanks... waiting.....
I am sure Daniel will be kind enough to post any information he has right here at the ranch so everyone can benefit. Is there any reason it has to be sent only through email ? A score is more reflective of a person's preparation and understanding of the subject than what they used to study the subject. Just my thoughts
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
Ashok Pradhan
Ranch Hand
Joined: Dec 17, 2007
Posts: 179
|
|
Thanks John. No there is not such specific reason for sending in e-mail but it depends upon Daniel.
|
 |
 |
|
|
subject: Doubt on Thread state
|
|
|