Conditionals and Control Flow 10 Switch Statement


Does anyone know what I am doing wrong please?

public class Switch {
public static void main(String[] args) {

	char penaltyKick = 'L', 'R', 'C';

	switch (penaltyKick) {

		case 'L': System.out.println("Messi shoots to the left and scores!");
		case 'R': System.out.println("Messi shoots to the right and misses the goal!");
		case 'C': System.out.println("Messi shoots down the center, but the keeper blocks it!");
    System.out.println("Messi is in position...");





your error is here

You are assigning the variable the wrong way.In Java you can assign multiple variables on one line like this

char first = 'L', second = 'R', third = 'C';

but you cannot assign multiple values to a variable as you are doing up there. You can only put one char so remove two

you might wanna put this statement

before your switch statement