Conditionals and Control Flow 10 Switch Statement


#1

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!");
							break; 
		case 'R': System.out.println("Messi shoots to the right and misses the goal!");
							break;
		case 'C': System.out.println("Messi shoots down the center, but the keeper blocks it!");
							break;
		default:
			System.out.println();
    
    System.out.println("Messi is in position...");

	}

}

}


#3

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

Also
you might wanna put this statement

before your switch statement