[Logo]
Forums Register Login
newly created thread state?
source : http://www.santis.ch/training/java/jcp/selftester

exact question is this :
what is the initial state of a new created and started thread?

and options are :
1. New
2. Not Runnable
3. Ready
4. Running
5. Dead

I selected Running because I saw the word "started" in the question.. that means start() was called.. did I interpret it wrong? Anyone else feels question is not so clear ?
What are we supposed to do? What do you expect from us, the ranchers?
Please be kind enough to post the code!
If a thread was started (by invoking start()) its state is "Runnable". Other states are "New", "Running", "Waiting/Blocking" and "Dead"; all based on K&B.

cheers
Bob
 

sudipto shekhar wrote:What are we supposed to do? What do you expect from us, the ranchers?



1. I asked the ranchers, did I interpret the question wrong ?

sudipto shekhar wrote: Please be kind enough to post the code!



2. I asked you the exact question and I have given the link to the source.. there is no code for it... it is a "question" if you didn't notice.. and there are 5 choices, I selected one of them and the mock test told me I was wrong.. So I asked, " Did I interpret it wrong ? "

Sorry, I dont understand why you were mad at me..
 

Bob Wheeler wrote:If a thread was started (by invoking start()) its state is "Runnable". Other states are "New", "Running", "Waiting/Blocking" and "Dead"; all based on K&B.



Runnable means "Ready" here ? So it is not yet running?
 

Shrinath M Aithal wrote:

Bob Wheeler wrote:If a thread was started (by invoking start()) its state is "Runnable". Other states are "New", "Running", "Waiting/Blocking" and "Dead"; all based on K&B.



Runnable means "Ready" here ? So it is not yet running?


I guess so. But I have never heard of this status. I don't know on what basis this test is done.
Runnable means, the thread is "ready" to start. The thread can come back to this status after waiting/blocking. I just don't like to give this status a different name.
If you get a question like this in the exam, they'll use the term "Runnable".
To answer your question: yes.

cheers
Bob
ok Bob.. thank you seems like a lot of things are wrong with this test.. if you open the scjp mock tests page in ranch, it is the third one, which opens up a german site..

there are misleading answers too.. like the test says + is not overloaded in wrapper classes..
So no worries..
thank you
 

Shrinath M Aithal wrote:ok Bob.. thank you seems like a lot of things are wrong with this test.. if you open the scjp mock tests page in ranch, it is the third one, which opens up a german site..

there are misleading answers too.. like the test says + is not overloaded in wrapper classes..
So no worries..
thank you


No prob.
I didn't use them. I used examLab (5 exams altogether) and the K&B stuff (2 exams+1). First of all I would use them. I really liked them
The examLab was really tough, but afterwards you know where you have to invest some time.

Have Fun and cheers
Bob
 

Shrinath M Aithal wrote:

Bob Wheeler wrote:If a thread was started (by invoking start()) its state is "Runnable". Other states are "New", "Running", "Waiting/Blocking" and "Dead"; all based on K&B.



Runnable means "Ready" here ? So it is not yet running?




Runnable means it is ready to run. to be more precise, it means that the process is ready to execute but is not yet scheduled by the processor to run. Running means that the process is currently being executed..
When the thread is popped back to runnable that means again the thread is ready to run but is not running. yes when the start() is invoked that means the thread is ready to run but is not scheduled by the scheduler to run...Which thread is scheduled at what time completely depends on the scheduler and the scheduling algorithm that is being used by the system....

Hope this helps....

This thread has been viewed 1047 times.

All times above are in ranch (not your local) time.
The current ranch time is
Sep 21, 2018 23:20:29.