title: Java see if arraylist contains string
body: <p>I have a class called <code>Paragens</code> like this:</p>
  
  <pre><code>public class Paragens {
      static int contadorParagens = 1;
  
      String nomeParagem;
      int id;
  
      public Paragens(String nomeParagem) {
          this.nomeParagem = nomeParagem;
          this.id = contadorParagens++;
      }
  
      // getters and setters for nomeParagem
  }
  </code></pre>
  
  <p>Every Paragens object has a name and an Id.</p>
  
  <p>This class has a main method where I create several Paragens objects and store them inside an ArrayList like this:</p>
  
  <pre><code>public static void main(String[] args) {
      ArrayList&lt;Paragens&gt; paragens = new ArrayList&lt;Paragens&gt;();
      paragens.add(new Paragens("name1");
      // ... add more paragens
  }
  </code></pre>
  
  <p>This is working ok. If I insert a bunch of paragens and print them I can see tat is all ok.</p>
  
  <p>What I am trying to do is to ask the user to input a paragem name and then I want to see if that paragem is already in the ArrayList.</p>
  
  <pre><code>String name;
  System.out.println("Insert paragem name: ");
  pickName = sc.nextLine();
  System.out.println(paragens.contains(pickName));
  </code></pre>
  
  <p>What am I doing wrong?</p>