blob: 6458aa09d279ed07bf3d1e14915f8dc009a3c60e [file] [log] [blame]
class ExpressionSwitch {
boolean odd(int x) {
return switch (x) {
case 0 -> true;
case 1 -> false;
default -> odd(x - 1);
};
}
{
int f =
switch (i) {
case 0 -> 0;
default -> {
yield n / i;
}
};
int g =
switch (i) {
case 0:
yield 0;
default:
yield n / i;
};
switch (i) {
case 0 -> {
System.out.println("0");
}
default -> System.out.println("default");
}
}
}