Link to home
Start Free TrialLog in
Avatar of harmeek_80
harmeek_80

asked on

How to detect the "enter" key is pressed in my console program

Hi 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.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial