title: How do i check if an Array List contains a certain string
body: <p>I've looked on here and what i got did not really work. Here is the code which runs but it's not doing what i expect it to do</p>
  
  <pre><code>package bcu.gui;
  
  import java.util.ArrayList;
  import java.util.Arrays;
  
  public class compare {
  
      private static ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
  
      public static void main(String[] args) {
          list.add("Paul");
          list.add("James");
  
          System.out.println(list); // Printing out the list
  
          // If the list containsthe name Paul, then print this. It still doesn't print even though paul is in the list
          if(Arrays.asList(list).contains("Paul")){
              System.out.println("Yes it does");
          }
  
      }
  
  }
  </code></pre>