I am a newbie to Java, and I'm trying to get a string from an input with multiple lines.
e.g. a string ="The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick fox jumps over the lazy dog. " from the input, like this:
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
I've tried to use a while loop with .nextLine() like this
String s="";
Scanner Input = new Scanner (System.in);
while(Input.hasNextLine()){
s = s + Input.nextLine() + " ";
}
But the loop just seemingly runs infinitely. Thanks for any help that can be given.