This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
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

Scanner debugging help

 
Haani Naz
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I have the following piece of code which fails at the point it needs to accept input and i can't seem to figure out why.






The issue is at line 115.


Here is the output:



As you can see instead accepting input it skips it.

can somebody please tell me why?

thanks in advance!
 
Anniruddh Rana
Greenhorn
Posts: 18
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Change that to



and give it a try.

i.e. use System.out.print there instead of System.out.println
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic