• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java program unexpectedly giving different results each time it is run

 
Ashish Ramteke
Ranch Hand
Posts: 88
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello folks! I am not getting why the Java program below is givingdifferent results each tme it is run.
I have Java 7 installed on my Windows 7 Home Basic PC. This is a code from an 'excercise' from the book, Head First Java 2nd ed..
The output should obviously be:
one 98098
two 98099

Can you figure it out?

 
Ashish Ramteke
Ranch Hand
Posts: 88
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys! I found that this issue is already resolved as far as the output is concerened in the 'Beginning Java' forum.
Here is its link:
http://www.coderanch.com/t/504869/java/java/TestThreads-Code-Magnets-exercise-Head
I found this link in the 'Similar Threads' section below...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic