class Main {
static String classify(int n) {
// arrow labels never fall through, and this yields a value
return switch (Integer.signum(n)) {
case -1 -> "negative";
case 0 -> "zero";
default -> "positive";
};
}
public static void main(String[] args) {
System.out.println(classify(-5) + " " + classify(0) + " " + classify(9));
}
}arrow-form switch returns a value