java wait for user to press enter code example Example: java pause program until key pressed System.in.read()