cannot resolve symbol rank.length
That's because you try to access rank.length
before declaring rank
.
Try:
//first declare arrays
// create a deck of 52 cards
String[] suit = { "Clubs", "Diamonds", "Hearts", "Spades" };
String[] rank = { "2", "3", "4", "5", "6", "7", "8", "9", "10",
"Jack", "Queen", "King", "Ace"
};
//then find out their length
int suits = suit.length;
int ranks = rank.length;
int n = suits * ranks;
//counter
int m = 5;
Package java.Random does not exist
It's true, it's import java.util.Random
, not import java.Random.*
, the java.Random
package doesn't exist.