I\'m trying to write a very simple number guessing game (code is below). After 1 round is finished, the user is supposed to be able to decide whether he/she wants to play an
Use scan.next()+ scan.nextLine(); instead
eg.
Scanner scan = new Scanner(System.in);
String s = scan.nextLine() +scan.nextLine();
Problem occurs because the last newline character for the last line of input is still queued in the input buffer and the next nextLine() will be reading the remainder of the line (which is empty).
So, when you use next it goes to the next token, then you can get the remaining input using nextLine()