1String[] available_cards = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Queen", "King", "Jack", "Ace"};
2java.util.Random random = new java.util.Random();
3int random_computer_card = random.nextInt(available_cards.length);
4System.out.println(available_cards[random_computer_card]);
1private int getRandomIndex(int arrayLength) {
2 Random r = new Random();
3 return r.nextInt(arrayLength);
4}