Control flow / Conditional statements / switch/case statements

int getMonitorSize() {
    return 24;
}

var inchSize = getMonitorSize();
//Java 12 Feature
String str = switch (inchSize) {
    case 16,17,18,19 -> "good for the past decade";
    case 20,21,22,23 -> "for office work";
    case 24,25,26,27 -> "great choice";
    default -> {
        //Java 13 Feature
        if (inchSize < 16) {
            yield "too small";
        }
        yield "are you sure this isn't a TV?";
    }
};       
//numberList = "1-2-3"

System.out.printf(
    "Screen size %d', %s", inchSize, str);


Swift provides a shorthand spelling of switch that you can use when setting values.