OutOfBoundsException error when creating an ArrayList : <p>I am trying to make a deck of cards. So far I have this:</p>

<pre><code>import java.util.*;
public class Card {
    public static void main(String[] args) {
        ArrayList&lt;String&gt; rank = new ArrayList&lt;String&gt;(Arrays.asList("Ace", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"));
        ArrayList&lt;String&gt; suite = new ArrayList&lt;String&gt;(Arrays.asList("Spades", "Hearts", "Clubs", "Diamonds"));
        ArrayList&lt;String&gt; deck = new ArrayList&lt;String&gt;();
        String card;


        for (int i = 0; i &lt; rank.size(); i++) {
            for (int p = 0; i &lt; suite.size(); p++) {
                card = rank.get(i) + " of " + suite.get(p);
                deck.add(card);
            }
        }
        System.out.println(deck);
    }
}
</code></pre>

<p>I am getting an IndexOutOfBoundsException error on this line:</p>

<pre><code>card = rank.get(i) + " of " + suite.get(p);
</code></pre>
