title: Java password checker with strings
body: <p>Been fighting with this for awhile, still new to java and really struggling with this assignment. We're meant to make a password checker assignment that checks if 2 entered passwords are the same. Then also check them against some "requirements" such as password length of at least 8 characters, one special character, one upper and one lower case, no repeating characters more than 3 times consecutively, (ie "aaa"). </p>
  
  <p>Any input or criticism is very much appreciated and thank you in advance.</p>
  
  <pre><code>import java.util.Scanner;
  
  /**
   *
   * @author Jonot
   */
  public class Passwords {
  
      /**
       * @param args the command line arguments
       */
      public static void main(String[] args) {
          //Asks and records users inputted passwords
          Scanner input = new Scanner(System.in);
          System.out.println("Please enter your password");
          String password = input.nextLine();
          System.out.println("Please re-enter your password");
          String passwordCheck = input.nextLine();
          //boolean to check if the inputted passwords meets requirements set below
          boolean check;
          check = isConfirmed(password);
          while (!password.equals(passwordCheck) || (!check)) {
              System.out.println("The password you entered is invalid");
              System.out.println("Please try again");
              password = input.nextLine();
              System.out.println("please re-enter");
              passwordCheck = input.nextLine();
  
              check = isConfirmed(password);
              //String password = input.nextLine();
              //check = isConfirmed(password);
  
              //if passwords meets boolean requirements, 
              if (isConfirmed(password)) {
                  //this will print out. Doesn't work right now.
                  System.out.println("password is valid");
              } else {
              }
  
          }
  
      }
      //Boolean variables and they're set requirements. Do not work right now.
      //Not sure why.
  
      public static boolean isConfirmed(String password) {
          Boolean leastOneUpperCase = false;
          Boolean leastOneLowerCase = false;
          Boolean leastOneDigit = false;
          Boolean oneSpecialCharacter = false;
  
          if (password.length() &lt; 8) {
              return false;
          }
  
          for (int i = 0; i &lt; password.length(); i++) {
              if (Character.isUpperCase(password.charAt {i
  
                      ));
  
                      {
                leastOneUpperCase = true;
                  }
                  else if (Character.isLowerCase(password.charAt(i)));
                  {
                      leastOneLowerCase = true;
                  }
                  else if (Character.isDigit(password.charAt(i)));
                  {
                      leastOneDigit = true;
                  }
              }
              return (leastOneUpperCase &amp;&amp; leastOneLowerCase &amp;&amp; leastOneDigit);
  
          }
          return false;
      }
  </code></pre>