Hi, I want the user who can press the ENTER key and then go to the next function. e.g. Press ENTER key to calculate the number of year. How can I use it with System.in? Thanks for help Andrew
posted 14 years ago
With System.in, enter is the only key press you can detect as soon as it happens. If you call readLine() it will return as soon as the user hits enter. The user may have typed other things as well, but you can ignore them.