title: why won't my counter count properly ? it adds +1 although my if statement isnt filled
body: <p>So my counter is supposed to not count +1 for the string <code>&quot;:DD&quot;</code> that's why I wrote that only if the length of my string is <code>2</code> the counter should add +1. But it adds +1 although the string length is 3.  Why is that?</p>
  <p>P.S.: I've put <code>length() &lt;=3</code> in the first <code>if</code> statement, for another <code>else if</code> that comes after the 2nd <code>if</code> statement.</p>
  <pre class="lang-java prettyprint-override"><code>int counter = 0;
  String tgt = &quot;:DD&quot;;
  
  for (int i = 0; i &lt; a.size(); i++) {
      if (tgt.length() &lt;= 3 &amp;&amp; tgt.charAt(0) == ':' || tgt.charAt(0) == ';') {
          if (tgt.length() == 2 &amp;&amp;  
              tgt.charAt(1) == ')' || tgt.charAt(1) == 'D') {
                  counter += 1;
          }
      }
  }
  </code></pre>