title: Swap cards in deck
body: <p>How to swap the position of two cards in the deck of <code>ArrayList&lt;Card&gt;</code>?</p>
  
  <pre><code>public class Deck
  {
      private ArrayList&lt;Card&gt; deck;
  
      public Deck()
      {
          deck = new ArrayList&lt;Card&gt;();
      }
  
      public void addCard(Card cardToAdd)
      {
          deck.add(cardToAdd);
      }
  }
  </code></pre>