Original Post
Im trying to swap things in an array list using java and its not working at all. It is really getting on my nerves. As you can see I was expecting it to swap the references in the array list and its not doing this. Can someone show me how to do this?
public void shuffleDeck()
{
Random generator = new Random();
Object [] cardArray = m_Cards.toArray();
for(int x=0; x<generator.nextInt(1000)+10; x++)
{
for(int i=0; i<52; i++)
{
int randomIndex = generator.nextInt(52);
swap((Card)m_Cards, (Card)m_Cards[randomIndex]);
}
}
}