Created
October 13, 2017 21:43
-
-
Save mcupak/b2977d3a918cc96c1197ea2b814b15d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jshell> import jdk.jshell.* | |
| jshell> JShell js = JShell.create() | |
| js ==> jdk.jshell.JShell@c8e4bb0 | |
| jshell> List<SnippetEvent> snippets = js.eval("1+1") | |
| snippets ==> [SnippetEvent(snippet=Snippet:VariableKey($1)#1-1 ... ,causeSnippetnullvalue=2)] | |
| jshell> snippets.stream().map(s -> s.value()).forEach(System.out::println) | |
| 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment