Return array in Java
<p>I have my primary class running, and I wanted to run a separate class to shuffle numbers, then return the shuffled numbers into my primary class.  In my shuffle class I have the return statement... but now what do I do?  How do I use the random order of my int array in my primary class?</p>

<p>Here is my shuffle class:</p>

<pre><code>public class Shuffle {
public static int[] getShuffle() {
    int[] cards = new int[52];
    ArrayList&lt;Integer&gt; cards_objs = new ArrayList&lt;Integer&gt;();

    for (int i = 0; i &lt; cards.length; i++) {
        cards_objs.add(i);
    }

    Collections.shuffle(cards_objs);

    for (int i = 0; i &lt; cards.length; i++) {
        cards[i] = cards_objs.get(i);

    }

    return cards;
}
</code></pre>

<p>}</p>

<p>I am making a card game(if you cant tell);</p>

<p>I wanted to use this shuffle class so that the cards are shuffled... but no card appears more than once.</p>

<p>when I return cards, how do I use them in my game class?
for example if the first number in the array is 1, then the card is Ace of clubs,
if the number is 2, then the card is Ace of diamonds. and so on...
I apologize for not posting enough information... I am new to java (as you can tell)</p>

<p>all help will be greatly appreciated,</p>

<p>-Steve</p>

<p>EDIT:
I found out what my problem was, I don't think I made it clear enough what my question was.  Nonetheless thank you all for your help, it gave me ideas on different ways to approach this project. </p>
