Just adding too, I think some of the switch statement example code is wrong:
Object obj = 123L;
String formatted = switch (obj) {
case Integer i -> String.format("int %d", i);
case Long l -> String.format("long %d", l);
case Double d -> String.format("double %f", d);
case String s -> String.format("String %s", s);
default -> o.toString();
};
Unless I'm not understanding something, the default statement should be `obj.toString()` as `o` isn't defined.