title: Check if string has digits
body: <p>How to check if passCode contains digits? I have to use the method isDigit()<br>
  I know how to check only one character with charAt() , but not with the entire word.</p>
  
  <pre><code>public class CheckingPasscodes {
      public static void main (String [] args) {
         boolean hasDigit = false;
         String passCode = "";
         int valid = 0;
  
         passCode = "abc";
  
         // if (?)
         hasDigit = true;
  
         if (hasDigit) {
            System.out.println("Has a digit.");
         } else {
            System.out.println("Has no digit.");
         }
         return;
      }
  }
  </code></pre>