title: Finding matching strings in a String array
body: <p>I'm having trouble extracting the names that contain more than 3 "O" or "o" in them from a string array. I have to print them after.  Where did I go wrong and how can I fix it? </p>
  
  <pre><code>static String[] towns = {"England", "France",
      "Romania", "Germany", "Canada", "Russia",
        "Eoeoeooero"};
  
   public static void main(String[] args) {
  
  
      for (int i = 0; i &lt; towns[i].length(); i++) {
  
  
  
              for (int j = 0; j &lt; towns[i].length(); j++) {
                  if (towns[i].charAt(j) == 'o' || towns[i].charAt(j) == 'O') {
                      e++;
                  }
              }
  
              if (e &gt; 3) {
                  System.out.println(towns[i]);
              }
          }
      }
  
  }
  </code></pre>