title: Password finder (something like bruteforce) Java
body: <p>I have problem with the code. 
  the program is finding every password with 1 letter and 3 letters.
  password with 2 letters the program only find the password "11".
  same way with 5 letters only finding "11111".
  with 4/6 letters the program doesnt find any password.</p>
  
  <p>the code with alot "if" sorry about the mess but thats the only way I was thinking  about to create the Password finder.(The program is a personal project for practicing)</p>
  
  <pre><code>package passwordfind10num;
  import java.util.Scanner;
  
  public class Passwordfind10num {
  
      public static void main(String[] args) {
          char[] charArray = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
              'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'g', 'k', 'l',
              'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
              'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'G',
              'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
              'W', 'X', 'Y', 'Z', '!', '@', '#', '$', '%', '^', '&amp;', '*',
              '(', ')', '_', '-', '+', '=', '\\', '|', ',', '&lt;', '&gt;', '/',
              '?', '~' }; 
  
          Scanner in = new Scanner(System.in);
  
          System.out.println("Enter a password");
          String password = in.next();
  
          String found = "";
          int array = -1;
          int array2 = -1;
          int array3 = -1;
          int array4 = -1;
          int array5 = -1;
          int array6 = -1;
  
          while (!found.equals(password)) {
              if (array5 == 83) {
                  array6++;
                  array5 = 0;
                  array4 = 0;
                  array3 = 0;
                  array2 = 0;
                  array = 0;
                  found = String.valueOf(charArray[array6] + charArray[array5]
                          + charArray[array4] + charArray[array3])
                          + String.valueOf(charArray[array2])
                          + String.valueOf(charArray[array]);
              } else if (array4 == 83) {
                  array5++;
                  array4 = 0;
                  array3 = 0;
                  array2 = 0;
                  array = 0;
                  if (array6 == -1)
                      found = String.valueOf(charArray[array5]
                              + charArray[array4] + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else
                      found = String.valueOf(charArray[array6]
                              + charArray[array5] + charArray[array4]
                              + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
  
              } else if (array3 == 83) {
                  array4++;
                  array3 = 0;
                  array2 = 0;
                  array = 0;
  
                  if (array6 == -1 &amp;&amp; array5 == -1)
                      found = String.valueOf(charArray[array4]
                              + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else if (array6 == -1)
                      found = String.valueOf(charArray[array5]
                              + charArray[array4] + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else
                      found = String.valueOf(charArray[array6]
                              + charArray[array5] + charArray[array4]
                              + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
  
              } else if (array2 == 83) {
                  array3++;
                  array2 = 0;
                  array = 0;
  
                  if (array6 == -1 &amp;&amp; array5 == -1 &amp;&amp; array4 == -1)
                      found = String.valueOf(charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else if (array6 == -1 &amp;&amp; array5 == -1)
                      found = String.valueOf(charArray[array4]
                              + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else if (array6 == -1)
                      found = String.valueOf(charArray[array5]
                              + charArray[array4] + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else
                      found = String.valueOf(charArray[array6]
                              + charArray[array5] + charArray[array4]
                              + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
  
              } else if (array == 83) {
                  array2++;
                  array = 0;
  
                  if (array6 == -1 &amp;&amp; array5 == -1 &amp;&amp; array4 == -1
                          &amp;&amp; array3 == -1)
                      found = String
                              .valueOf(charArray[array2] + charArray[array]);
                  else if (array6 == -1 &amp;&amp; array5 == -1 &amp;&amp; array4 == -1)
                      found = String.valueOf(charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else if (array6 == -1 &amp;&amp; array5 == -1)
                      found = String.valueOf(charArray[array4]
                              + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else if (array6 == -1)
                      found = String.valueOf(charArray[array5]
                              + charArray[array4] + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else
                      found = String.valueOf(charArray[array6]
                              + charArray[array5] + charArray[array4]
                              + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
  
              } else {
                  array++;
                  if (array6 == -1 &amp;&amp; array5 == -1 &amp;&amp; array4 == -1
                          &amp;&amp; array3 == -1 &amp;&amp; array2 == -1)
                      found = String.valueOf(charArray[array]);
                  else if (array6 == -1 &amp;&amp; array5 == -1 &amp;&amp; array4 == -1
                          &amp;&amp; array3 == -1)
                      found = String
                              .valueOf(charArray[array2] + charArray[array]);
                  else if (array6 == -1 &amp;&amp; array5 == -1 &amp;&amp; array4 == -1)
                      found = String.valueOf(charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else if (array6 == -1 &amp;&amp; array5 == -1)
                      found = String.valueOf(charArray[array4]
                              + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else if (array6 == -1)
                      found = String.valueOf(charArray[array5]
                              + charArray[array4] + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
                  else
                      found = String.valueOf(charArray[array6]
                              + charArray[array5] + charArray[array4]
                              + charArray[array3])
                              + String.valueOf(charArray[array2])
                              + String.valueOf(charArray[array]);
  
              }
          }
          System.out.println("password found:" + " " + found);
      }        
  }
  </code></pre>