You are viewing a single comment's thread. Return to all comments →
Instead of storing the input in a seperate string and printing the string...
String input = scanner.nextLine();
I instead just print out the input
Not sure if that was your question. If you are confused as to how it knows when to stop looking for input, the statement:
Will continue looping over and over again until scanner.hasNext() returns false, meaning there is nothing left to read from the Scanner.