title: The type of the expression must be an array type but it resolved to ArrayList<Integer>
body: <p>I'm trying to put the <code>ints</code>into the <code>Arraylist myList</code> but Eclipse is pointing to the error:
  <code>The type of the expression must be an array type but it resolved to ArrayList&lt;Integer&gt;</code></p>
  
  <p>I tried to convert from primitive type into Object type but still getting the same error. COuld smb please help me out with that ?</p>
  
  <pre><code>import java.util.*;
      public class RemoveDuplicates {
  
          public static void main(String[] args){
  
              int[] myArray = {1,1,2,3,4,5,6,7,8,8,9,9,99};
              ArrayList&lt;Integer&gt; myList = new ArrayList();
  
              for(int i = 0; i &lt; myArray.length; i++){
                  for(int j = 1; j &lt; myArray.length; j++){
                      if(myArray[i] == myArray[j]){
                          myList.add(myList[i]);
                      }
                  }
              }
          }
      }
  </code></pre>