public class SwitchOnLong { public static void main(String[] args) { long n = 1L; String s = switch (n) { // switch on long: not allowed without the preview case 0L -> "zero"; default -> "other"; }; System.out.println(s); } }