title: Java isLetterOrDigit() method, isDigit(), isLetter()
body: <p>I am trying to figure out how to check a <code>String</code> to validate whether it had at least one letter and one number in it. I will be upfront that this is homework and I am a little confused.</p>
  
  <p>There is a method <code>isLetterOrDigit()</code> method that seems it would be the right approach, but I am undure as how I would implement this in my code. Here is the code I am using below:</p>
  
  <pre><code>import javax.swing.JOptionPane;
  
  public class Password
  {
      public static void main(String[] args)
      {
  
      String initialPassword;
      String secondaryPassword;
      int initialLength;
  
      initialPassword = JOptionPane.showInputDialog(null, "Enter Your Passowrd.");
  
      initialLength = initialPassword.length();
  
      JOptionPane.showMessageDialog(null, "initialLength = " + initialLength);
  
      while (initialLength &lt; 6 || initialLength &gt; 10)
      {
          initialPassword = JOptionPane.showInputDialog(null, "Your password does not meet the length requirements. It must be at least 6 characters long but no longer than 10.");
          initialLength = initialPassword.length();
      }
  
      //Needs to contain at least one letter and one digit
  
      secondaryPassword = JOptionPane.showInputDialog(null, "Please enter your password again to verify.");
  
      JOptionPane.showMessageDialog(null, "Initial password : " + initialPassword + "\nSecondar Password : " + secondaryPassword);
  
      while (!secondaryPassword.equals(initialPassword))
      {
          secondaryPassword = JOptionPane.showInputDialog(null, "Your passwords do not match. Please enter you password again."); 
      }
  
      JOptionPane.showMessageDialog(null, "The program has successfully completed."); 
  
      }
  }
  </code></pre>
  
  <p>I want to implement a method where the comment section is using either the <code>isDigit()</code>, <code>isLetter()</code>, or <code>isLetterOrDigit()</code> methods, but I just don't know how to do it.</p>
  
  <p>Any guidance would be appreciated. Thanks in advance for the assistance.</p>