Skip to content

Instantly share code, notes, and snippets.

@sormuras
Created August 26, 2021 17:57
Show Gist options
  • Save sormuras/68c42fb84a13abbebd22c6f281bceae0 to your computer and use it in GitHub Desktop.
Save sormuras/68c42fb84a13abbebd22c6f281bceae0 to your computer and use it in GitHub Desktop.
jshell> Integer i = 5
i ==> 5
jshell> switch(i) {
...> case Integer i && i > 9 -> System.out.println(">9");
...> default -> System.out.println("...");
...> }
...
jshell> Integer i = 50
i ==> 50
jshell> switch(i) {
...> case Integer i && i > 9 -> System.out.println(">9");
...> default -> System.out.println("...");
...> }
>9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment