Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First Java: Guessing Game infinite look

 
Ivan Akunenko
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run the Guessing Game code from Head First Java and run into an infinite loop.

Here is the code:



And here is the output I get:



Pretty confused where the problem is.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.
Pretty confused where the problem is.

while (true) Smell something fishy here?
 
Daniel Vlad
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try and take a better look at your if statements, you will notice you missed something
 
Ivan Akunenko
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, got it. Missed a break. Thanks everyone.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic