java - How to write an if condition for return key or enter ket -


i writing program in java in want if user presses "return" key next statement should executed. but, can't understand how write if condition "return key" or enter key in code. please me?

unless i'm missing check nextline() scanner.

scanner s = new scanner(system.in); system.out.println("press enter continue"); s.nextline(); system.out.println("thank you"); 

Comments

Popular posts from this blog

Prolog - Listing -

python - can't seem to get an output from my class -

orchardcms - change base url in local copy in Orchard CMS -