I'm trying to write a java program to handle continuous type in, character by character. Basically, it means, there's a string variable "input" to record the current typed in string. So, if the current type in is "W", than input should be "W" and the user keeps type in "h" the input should be "Wh" and so on.
I want it to be character by character, I think it should be some while loop using scanner?
OK. I can do it string by string. but when does the Scanner stops? I tried:
while(in.hasNext()){ String temp = in.next(); if(temp.equals("")){ break; } }
But the Scanner didn't stop. The loop didn't stop. What's the input value of java from the "Enter Return" Key? Do I need to import the keyboard listener?