Files
2023-03-22 10:22:34 +01:00

29 lines
382 B
Java

public class Switch12 {
public void basic() {
switch (5) {
case 1:
case 2:
System.out.println("OK");
break;
default:
}
}
public void multiCase() {
switch (5) {
case 1, 2:
System.out.println("OK");
default:
}
}
public int switchExpr() {
return switch (5) {
case 1, 2 -> 0;
case 3 -> {
break 10;
}
default -> 10;
} + 10;
}
}