Can I disable Pressing Enter before putting in the input in console?

Answered

What I mean by the title is when I run a program with Scanner, is that I have to press Enter or write whatever and then enter. It doesn't take the value right away, so if I have an input I got to type two lines for it to work.

Guess picture show better than words:

 

 

Can I disable so ones I enter the "499" value first time, the program will continue to run?

Whatever I write on the first line it doesn't read, but whatever comes on second line it does.

Code is nothing special, so I don't understand why this happens.

 

0
1 comment

The issue could be related to running via Gradle, try running the main class directly using the Application run/debug configuration.

Disable the build/run delegation: http://mrhaki.blogspot.com/2016/11/gradle-goodness-delegate-build-and-run.html .

0

Please sign in to leave a comment.