title: Make the console wait for a user input to close
body: <p>I have a console application that after performing its tasks, must give feedback to the user, such as "operation completed" or "operation failed" and the detailed error.</p>
  
  <p>The thing is, if I just "let it run", the output message will be printed but the console will close shortly afterwards, leaving no time to read the message.</p>
  
  <p>As far as I remember, in C++, every console application will end with a "press any key to exit" or something like that. In C# I can simulate this behavior with a </p>
  
  <pre><code>Console.ReadKey();
  </code></pre>
  
  <p>But how can I do it in Java? I'm using the Scanner class, but given that "input" is my instance of Scanner:</p>
  
  <pre><code>input.next()
  System.exit(0);
  </code></pre>
  
  <p>"Any key" will work, except for return, which is quite a big deal here. Any pointers?</p>