I am making an applet that displays a random collection of 10 cards based upon 10 random integers.
My idea was to make an array of the 52 displayable cards (not including jokers) and display each cards from the array based upon the random integer like this (sorry i don't know how to use code blocks):
for (int i = 0; i<cards.length; i++) { //cards being my image array
//code that displays each image
}
But I ran into trouble trying to add images into the array and I don't know how to display the images from the array either.
Should I be adding them like this:
Image[] cards = new Image[52];
cards[0] = c1; //name of the Ace of Clubs, I had used getImage() to already get it
The preceding statements throw up errors saying it's an illegal start.
I also need help with displaying the images once I incorporate the images since I don't think:
System.out.println(cards[x]);
Will work with images.
Thanks in advance and sorry for seeming so complicated, I've tried to water it down as much as possible!

java.util.Listimplementation, such asjava.util.ArrayList?