public class Main {
public static void main(String[] args) {
int day = 3;
String dayType = switch(day) {
case 1, 2, 3, 4, 5 -> "Weekday";
case 6, 7 -> "Weekend";
default -> "Unknown";
};
System.out.println("Today is a " + dayType);
}
}
However, when I compile this code, I get the following error:
Error: ‘;’ expected
case 1, 2, 3, 4, 5 -> “Weekday”;