View devoxx-exploring-reactive.jsh
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
Thread t = new Thread(() -> System.out.println("hello guadalajara")) | |
t.start() | |
ExecutorService e = Executors.newSingleThreadExecutor() | |
Future<String> f = e.submit(() -> "hello guadalajara") | |
f | |
f.get() | |
ExecutorService e = ForkJoinPool.commonPool() | |
Future<String> f = e.submit(() -> "hello guadalajara") | |
f.get() | |
CompletableFuture<String> cf = new CompletableFuture<String>() |
View devoxx-type-inference.jsh
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
var x = "hello" | |
/v x | |
var list = new ArrayList<String>() | |
/v list | |
int x | |
var x | |
var x = null | |
var x = (Integer) null | |
int x=0, y=0 | |
var x=0, y=0 |
View confoo-exploring-java.jsh
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
HttpHandler handler = he -> { | |
String body = "hello confoo"; | |
he.sendResponseHeaders(200, body.length()); | |
try (OutputStream os = he.getResponseBody()) { | |
os.write(body.getBytes()); | |
} | |
} | |
/l handler | |
HttpServer hs = HttpServer.create(new InetSocketAddress(8000), 0) |
View confoo-type-inference.jsh
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
var x = "hello" | |
/v x | |
var list = new ArrayList<String>() | |
/v list | |
int x | |
var x | |
var x = null | |
var x = (Integer) null | |
int x=0, y=0 | |
var x=0, y=0 |
View devnexus.jsh
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
Set<Integer> set = new HashSet<Integer>() | |
set.add(1) | |
set.add(2) | |
set.add(3) | |
set = Collections.unmodifiableSet(set) | |
Collections.unmodifiableSet(new HashSet<>Arrays.asList(1,2,3))) | |
Collections.unmodifiableSet(new HashSet<>Arrays.asList(1,2,3)) | |
Collections.unmodifiableSet(new HashSet<>(Arrays.asList(1,2,3))) | |
Collections.unmodifiableSet(new HashSet<Integer>() {{ add(1); add(2); add(3); }}) | |
ImmutableSet.of(1,2,3) |
View djug.jsh
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
List<Integer> list = new ArrayList<Integer>() | |
list.add(1) | |
list.add(2) | |
list.add(3) | |
list = Collections.unmodifiableList(list) | |
Collections.unmodifiableList(Arrays.asList(1,2,3)) | |
Collections.unmodifiableList(Stream.of(1,2,3).collect(toList())) | |
Collections.unmodifiableList(new ArrayList<Integer>() {{ add(1); add(2); add(3); }}) | |
/env -class-path guava-27.1-jre.jar | |
import com.google.common.collect.ImmutableList |
View javadevdaymx-reactive.jsh
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
Thread t = new Thread(() -> System.out.println("hello guadalajara")) | |
t.start() | |
ExecutorService e = Executors.newSingleThreadExecutor() | |
Future<String> f = e.submit(() -> "hello guadalajara") | |
f | |
f.get() | |
ExecutorService e = ForkJoinPool.commonPool() | |
Future<String> f = e.submit(() -> "hello guadalajara") | |
f.get() | |
CompletableFuture<String> cf = new CompletableFuture<String>() |
View javadevdaymx-api-design.jsh
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
List<Integer> list = new ArrayList<Integer>() | |
list.add(1) | |
list.add(2) | |
list.add(3) | |
list = Collections.unmodifiableList(list) | |
Collections.unmodifiableList(Arrays.asList(1,2,3)) | |
Collections.unmodifiableList(Stream.of(1,2,3).collect(toList())) | |
Collections.unmodifiableList(new ArrayList<Integer>() {{ add(1); add(2); add(3); }} ) | |
/env -class-path guava-27.1-jre.jar | |
import com.google.common.collect.ImmutableList |
View tjug.jsh
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
var x = "hello" | |
/v x | |
var list = new ArrayList<String>() | |
/v list | |
int x | |
var x | |
var x = null | |
var x = (Integer) null | |
int x=0, y=0 | |
var x=0, y=0 |
View voxxed-minsk-api-design.jsh
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
List<Integer> list = new ArrayList<Integer>() | |
list.add(1) | |
list.add(2) | |
list.add(3) | |
list = Collections.unmodifiableList(list) | |
Collections.unmodifiableList(new ArrayList<>(Arrays.asList(1,2,3))) | |
Collections.unmodifiableList(Stream.of(1,2,3).collect(toList())) | |
Collections.unmodifiableList(new ArrayList<Integer>() {{ add(1); add(2); add(3); }}) | |
/env -class-path guava-27.1-jre.jar | |
import com.google.common.collect.ImmutableList |
NewerOlder