Question: I'm getting an error on line 24 of my code. My code is suposed to randomly choose a value from the array numbers. Then the
I'm getting an error on line 24 of my code. My code is suposed to randomly choose a value from the array "numbers". Then the variable "cardWorth" is dependent on which value from "numbers" is selected.
6 7 public static void start() > javac -classpath ../run_dir/junit-4.12.jcQxg et/dependency/* -d . Main.java Main.java:24: error: not a statement cardWorth == 2; 8 9 Scanner input = new Scanner(System.in); 10 11 1 error compiler exit status 1 String [] numbers= {"2", "3", "4", "5", "6","7", "8", "9", "10", "Jack", "Queen", "King","Ace"}; String [ltypes= {"Diamonds", "Hearts", "Spades", "Clubs"}; 12 13 14 15 16 17 18 19 Random number = new Random(); int ciNum = number.nextInt(numbers. length); Random type = new Random(); int clType = type.nextInt (types. length); int cardWorth; 20 21 if (clNum == numbers [0]) { cardWorth == 2; } w 22 23 24 25 26 27 28 29 30 31 32 }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
