title: IndexOutOfBoundsException error
body: <pre><code>public void thisisnotworking()
  {
      Scanner input=new Scanner(System.in);
      String cardA;
      String cardB;
      System.out.print("Enter Card: "); cardA=input.nextLine();
      System.out.print("Enter Card "); cardB=input.nextLine();
     Card a = game.get(game.indexOf(cardA));
     Card b = game.get(game.indexOf(cardB));
  </code></pre>
  
  <p>This code is part of a method i've written. Basically the user inputs the card that is one of the cards in an array list and then another card. Currently I'm getting an IndexOutOfBoundsException error when I'm running this part of the code.</p>
  
  <p>Can anyone tell me what is wrong with it?</p>