title: Why my IF can't get some of my ArrayList's indexes?
body: <p>My idea here is to check whether the elements of my ArrayList start with A, B, C, or with another letter, but for some reason, my IF can't get some words, such as "Almofada".</p>
  
  <pre><code>package ArrayLists;
  import java.util.Scanner;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Random;
  
  public class ArrayList2 {
      public static void main(String[] args) {
          //arraylist pra verificar quais strings começam com a,b,c
          ArrayList&lt;String&gt; words = new ArrayList&lt;&gt;(
          Arrays.asList(
          "Canivete",
          "Almofada",
          "Corda",
          "Parede",
          "Caixa",
          "Zilhão",
          "Dedo"  
          ));
  
          ArrayList abc = new ArrayList&lt;&gt;();
          ArrayList rest = new ArrayList&lt;&gt;();
  
          for(int i = 0; i &lt; words.size();i++){
              char firstChar = words.get(i).charAt(0);
              if(firstChar == 'A'||firstChar == 'B'||firstChar == 'C'){
                  abc.add(words.get(i));
                  words.remove(words.get(i));
              }else{
                  rest.add(words.get(i));
                  words.remove(words.get(i));
              }
          }
          System.out.println("Start with A,B or C: " + abc);
          System.out.println("Start with other letters: " + rest);
          System.out.println("Original array: " + words);
      }
  }
  </code></pre>
  
  <h2>Output</h2>
  
  <pre><code>Start with A,B or C: [Canivete, Corda, Caixa]
  Start with other letters: [Dedo]
  Original array: [Almofada, Parede, Zilhão]
  </code></pre>