How to detect enter key in console???
807598May 16 2006 — edited Mar 29 2007Hi Friends,
I have a loop in my program that asks the user to enter a number,I want that if the user presses the 'enter' key instead of entering any number,then the loop should exit.
But I don't know how to detect the 'enter' key as I am not using any GUI or ActionListener classes,is there some ASCII code for the enter key,that I can read and exit the loop.
Please help.