Whenever I use java.util.Scanner
, after a certain length, it no longer receives text from the user.
For example:
Scanner input = new Scanner(System.in);
String saySomething = input.next();
After I type a while, the words get cut off. For example, if the user types "Hello, my name is John", and I print the input, it only gives me something like "Hello," but I want it to print the entire sentence, i.e. "Hello, my name is John".
How do I fix this?