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

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -