title: Validating input using java.util.Scanner
body: <p>I'm taking user input from <code>System.in</code> using a <code>java.util.Scanner</code>. I need to validate the input for things like:</p>
  
  <ul>
  <li>It must be a non-negative number</li>
  <li>It must be an alphabetical letter</li>
  <li>... etc</li>
  </ul>
  
  <p>What's the best way to do this?</p>