wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt on Thread state Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt on Thread state" Watch "Doubt on Thread state" New topic
Author

Doubt on Thread state

Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Posts: 180

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: 180

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: 180

SORRY!!! i am forgotting my e-mail ID-ashokpradhan_61@yahoo.com
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

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 - More SCJP Mocks
Ashok Pradhan
Ranch Hand

Joined: Dec 17, 2007
Posts: 180

Thanks John.
No there is not such specific reason for sending in e-mail but it depends upon Daniel.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt on Thread state