title: How to use IndexOf to see if a string contain numbers
body: <p>I need to use <code>indexOf</code> to find numbers inside a string, and it gives me the error: </p>
  
  <blockquote>
    <p>Type mismatch: cannot convert from int to boolean.</p>
  </blockquote>
  
  <pre><code>public static boolean validPassword(String password) {
          if(password.length() &gt;= 8 ){
              return true;
  
          }
          else if (password.indexOf("0")) {
              return true;
          }
          return false;
      }
  </code></pre>