is there a way in Java to read input from console one word at a time? As in when user presses a space I want to take whatever word he typed before it and add it to a collection for example.
I've tried using Scanner, but it only allows me to read words after the end of a line (enter key press).
Context: It's a school project and teacher wants us to make a program that reads users input in one thread and displays list of words and their count from the input in another thread. And he wants the list updated after every new word is typed...