This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

find error within this problem (thread)  RSS feed

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



output
 
Bartender
Posts: 2038
273
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.
 
Master Rancher
Posts: 3276
33
  • 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.
 
Rancher
Posts: 2829
96
  • 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
Master Rancher
Posts: 3276
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deleted
 
Sheriff
Posts: 5121
138
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
Master Rancher
Posts: 3276
33
  • 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.
 
Marshal
Posts: 60127
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should be able to read the policy here.
 
Norm Radder
Master Rancher
Posts: 3276
33
  • 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: 2829
96
  • 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: 5121
138
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: 2829
96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Knute, it had nothing to do with you.
 
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!