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
Post a Comment