title: Java List error 'cannot find symbol - method getItem(int)'
body: <p>I am creating a short piece of code where I need to get an item from a list and compare it to a value.</p>
  
  <p>Despite importing java.util.List and writing the correct method call, it still claims it 'cannot find symbol - method getItem(int)'</p>
  
  <pre><code>import java.util.*;
  import java.util.List;
  
  public static int duplicateCharacters(String input) {
      boolean number = false;
  
      int highest = 0;
      int secondHighest = 0;
  
      if(input.length()&lt;=1){
        return -1;  
      }
  
      int[] newList = new int[] {0,1,2,3,4,5,6,7,8,9};
  
      for(int i=0; i&lt;input.length(); i++){
  
          number = false;
  
          int currentValue = input.charAt(i);
          for(int q=0; q&lt;newList.length; q++){
              if(newList.getItem(q) == currentValue){
                  number = true;
              }
          }
  
          if(number == true){
              if(currentValue&gt;highest){
                  secondHighest = highest;
                  highest = currentValue;
              }
          }
  
      }
  
      return secondHighest;
  
  }
  </code></pre>
  
  <p>In the Java doc, it states:</p>
  
  <blockquote>
    <p>getItem<br>
    public String getItem(int index)</p>
    
    <p>Gets the item associated with the specified index.</p>
    
    <p>Parameters:<br>
    index - the position of the item</p>
    
    <p>Returns:<br>
    an item that is associated with the specified index</p>
    
    <p>See Also:<br>
    getItemCount()</p>
  </blockquote>