title: How do I remove an element the user input from an ArrayList when it contains both strings and integers?
body: <p>I'm new to coding and I'm quite confused of how this ArrayList work.</p>
  <p>I have the [Java] code:</p>
  <pre><code>ArrayList&lt;Object&gt; allCards = new ArrayList&lt;Object&gt;();
  
  allCards.add(2);
  allCards.add(2);
  allCards.add(3);
  allCards.add('K');
  allCards.add('J');
  </code></pre>
  <p>Printing out the <code>allCards</code>ArrayList, I have:</p>
  <pre><code>[2, 2, 3, K, J]
  </code></pre>
  <p>Right now, I need to take in an user input, and remove the user input from this ArrayList. How do I do that?</p>
  <p>I could use</p>
  <pre><code>Scanner scan = new Scanner(System.in);
  int i = scan.nextInt();
  
  allCards.remove(new Integer(i));
  </code></pre>
  <p>if the ArrayList only contains integers, but the user input could be either a char or an int, how do I remove that from the ArrayList?</p>
  <p>Also, if there are two of the same user input in the ArrayList like the number 2, I would only like to remove one of them.</p>
  <p>Thank you.</p>