• Post Reply Bookmark Topic Watch Topic
  • New Topic

find error within this problem (thread)  RSS feed

 
ovi de
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why I am getting wrong output?



output
 
Ron McLeod
Saloon Keeper
Posts: 1600
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at line #7. You are creating a new Thread object, but not specifying the target which contains the run() method.
 
Norm Radder
Ranch Foreman
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why I am getting wrong output?

What should the correct output be? Please post an example of the correct output.
 
Piet Souris
Rancher
Posts: 1983
67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Norm Radder
Ranch Foreman
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deleted
 
Knute Snortum
Sheriff
Posts: 4081
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can't put the genie back in the bottle, but let's not post complete solutions in the future. Illustrations are fine.
 
Norm Radder
Ranch Foreman
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree 100%. My post was to test what this forum's policy was.
 
Campbell Ritchie
Marshal
Posts: 55761
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be able to read the policy here.
 
Norm Radder
Ranch Foreman
Posts: 2240
28
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Piet Souris
Rancher
Posts: 1983
67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Knute Snortum
Sheriff
Posts: 4081
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was my tone hostile? If so, I apologize. I wish there were an emoji for normal tone of voice.
 
Piet Souris
Rancher
Posts: 1983
67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Knute, it had nothing to do with you.
 
Stephen M Davies
Greenhorn
Posts: 11
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a point of reference, in Java class names should start with a Capital Letter.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!