Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
JShell commands from the live demo of "REPL: Java developer’s new friend" talk at Devoxx US 2017.
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