Created
March 22, 2017 21:47
-
-
Save mcupak/d34fc866d89513add705c63f3181a9f2 to your computer and use it in GitHub Desktop.
JShell commands from the live demo of "REPL: Java developer’s new friend" talk at Devoxx US 2017.
This file contains 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
2+2 | |
int x = $1 *10 | |
$1 = 10 | |
/vars | |
/v | |
System.out.println("hello devoxx") | |
Thread.sleep(2000) | |
ZonedDateTime.now() | |
import java.time.* | |
ZonedDateTime.now() | |
/imports | |
String sayHello(String name){ return "hello "+name;} | |
sayHello("devoxx") | |
/m | |
class HelloPrinter{ public static void sayHello(){ System.out.println("hello devoxx");} } | |
HelloPrinter.sayHello() | |
/t | |
/drop sayHello | |
/m | |
/ed HelloPrinter | |
/open hellohandler.jsh | |
/list | |
HttpServer hs = HttpServer.create(new InetSocketAddress(8000),0) | |
hs.createContext("/hello", new HelloHandler()) | |
hs.start() | |
/env -class-path guava-21.0.jar | |
import com.google.common.collect.* | |
ImmutableSet.of(1,2,3) | |
Set.of(1,2,3) | |
$20.getClass() | |
/history | |
/save -history jshell-demo.jsh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment