Forums Register Login
find error within this problem (thread)
why I am getting wrong output?

(1 like)
Take a look at line #7. You are creating a new Thread object, but not specifying the target which contains the run() method.

why I am getting wrong output?

What should the correct output be? Please post an example of the correct output.
Assuming OP had this in mind:

output can be:

Runnable: two started to run.
Runnable: three started to run.
Runnable: one started to run.
two : 0
three : 0
two : 1
one : 0
two : 2
three : 1
three : 2
three : 3
three : 4
three : 5
two : 3
one : 1
two : 4
two : 5
two : Complited
three : Complited
one : 2
one : 3
one : 4
one : 5
(1 like)
We can't put the genie back in the bottle, but let's not post complete solutions in the future. Illustrations are fine.
I agree 100%. My post was to test what this forum's policy was.
You should be able to read the policy here.
(1 like)
Is this it:

We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.

Well, different people have different styles, and where one uses 400+K questions, others might give a code example.

In this specific case, I should not have given this code, I admit, but I was triggered by your obligate question.

But I have one request: can you reserve your hostile comments towards me exclusively for DreaimInCode, please?
Was my tone hostile? If so, I apologize. I wish there were an emoji for normal tone of voice.
No Knute, it had nothing to do with you.
As a point of reference, in Java class names should start with a Capital Letter.
Our first order of business must be this tiny ad:
Become a Java guru with IntelliJ IDEA

This thread has been viewed 537 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 24, 2019 21:17:00.