Below is code taken from Sun
Java Tutorial. From my reading of the code the first time this loop executes should it not populate cards[1] with the first card skipping cards[0]? I've tested the code in eclipse and it seems to work properly first populating card[0] so I'm hoping somebody can explain why i++ is not read as 1 the first time the loop executes?
public class Deck3 {
private static Card3[] cards = new Card3[52];
public Deck3() {
int i = 0;
for (Suit suit : Suit.values()) {
for (Rank rank : Rank.values()) {
cards[i++] = new Card3(rank, suit);
}
}
}
}