View voxxed-athens.jsh
1+1
int x = 1+1
System.out.println(x)
Thread.sleep(2000)
/vars
/methods
/types
/list
/l
/help
View diamond.jsh
List<String> myList = new ArrayList<>()
Supplier<String> helloSupplier = new Supplier<String>() {
@Override
public String get() {
return "hello geecon";
}
}
View myclass.jsh
class MyClass implements MyInterface {
@Override
public void abstractMethod() {
System.out.println("abstract method called");
}
}
View myinterface.jsh
interface MyInterface {
void abstractMethod();
default void defaultMethod() {
System.out.println("default method called");
}
}
View readfile.jsh
void readFile(String file) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
try (BufferedReader reader2 = reader) {
String line;
while ((line = reader2.readLine()) != null) {
System.out.println(line);
}
}
}
View geecon.jsh
1+1
int x = 1+1
System.out.println(x)
Thread.sleep(2000)
/vars
/types
/list
/l
/help
Set<String> set = new HashSet<String>()
View jwtb.jsh
/
1+1
int x = 1+1
System.out.println(x)
Thread.sleep(2000)
/vars
/types
int inc(int x) { return x+1; }
inc(5)
/list
View indexconf.jsh
1+1
int x = 1+1
System.out.println(x)
Thread.sleep(2000)
/vars
/types
/list
/l
/help
Set<String> set = new HashSet<String>()
View singajug.jsh
1+1
int x = 1+1
System.out.println(x)
Thread.sleep(2000)
/vars
/types
/list
/l
/help
Set<String> set = new HashSet<String>()
View convert-optional-to-stream.out
jshell> Optional.of("something").stream().forEach(System.out::println)
something
jshell> Optional.empty().stream().forEach(System.out::println)