// This program writes a prompt to the screen, // asking the user to type Q to quit. When the // user finally types Q and ENTER, the program // prints another message and then quits. class PromptForQChar { public static void main( String[] args ) { char inputChar; do { System.out.print("Enter Q to quit: "); inputChar = Stdin.getChar(); } while( inputChar != 'Q' ); System.out.println("We're done now, thanks for typing Q."); } }