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
| List<Integer> list = new ArrayList<Integer>() | |
| list.add(1) | |
| list.add(2) | |
| list.add(3) | |
| list = Collections.unmodifiableList(list) | |
| List<Integer> list2 = new ArrayList<Integer>(list) | |
| list2.add(4) | |
| List<Integer> list2 = Collections.unmodifiableList(new ArrayList<Integer>(list)) | |
| List<Integer> list = List.of(1,2,3) | |
| list.add(4) |
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
| List<Integer> list = new ArrayList<Integer>() | |
| list.add(1) | |
| list.add(2) | |
| list.add(3) | |
| list = Collections.unmodifiableList(list) | |
| List<Integer> list2 = new ArrayList<Integer>(list) | |
| list2.add(4) | |
| List<Integer> list2 = Collections.unmodifiableList(new ArrayList<Integer>(list)) | |
| List<Integer> list = List.of(1,2,3) | |
| list.add(4) |
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
| Thread t = new Thread(() -> System.out.println("hello thessaloniki")) | |
| t.start() | |
| ExecutorService e = Executors.newSingleThreadExecutor() | |
| Future<String> f = e.submit(() -> "hello thessaloniki") | |
| f | |
| f.get() | |
| ExecutorService e = ForkJoinPool.commonPool() | |
| Future<String> f = e.submit(() -> "hello thessaloniki") | |
| f.get() | |
| CompletableFuture<String> cf = new CompletableFuture<String>() |
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
| Thread t = new Thread(() -> System.out.println("hello devoxx")) | |
| t.start() | |
| ExecutorService e = Executors.newSingleThreadExecutor() | |
| Future<String> f = e.submit(() -> "hello devoxx") | |
| f | |
| f.get() | |
| ExecutorService e = ForkJoinPool.commonPool() | |
| Future<String> f = e.submit(() -> "hello devoxx") | |
| f.get() | |
| CompletableFuture<String> cf = new CompletableFuture<String>() |
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
| 1+1 | |
| int x = 1+1 | |
| System.out.println(x) | |
| Thread.sleep(2000) | |
| /vars | |
| /types | |
| /list | |
| /l | |
| /help | |
| Set<String> set = new HashSet<String>() |
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
| Thread t = new Thread(() -> System.out.println("hello bristol")) | |
| t.start() | |
| ExecutorService e = Executors.newSingleThreadExecutor() | |
| Future<String> f = e.submit(() -> "hello bristol") | |
| f | |
| f.get() | |
| ExecutorService e = ForkJoinPool.commonPool() | |
| Future<String> f = e.submit(() -> "hello bristol") | |
| f.get() | |
| CompletableFuture<String> cf = new CompletableFuture<String>() |
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
| Thread t = new Thread(() -> System.out.println("hello devfest")) | |
| t.start() | |
| ExecutorService e = Executors.newSingleThreadExecutor() | |
| Future<String> f = e.submit(() -> "hello devfest") | |
| f | |
| f.get() | |
| ExecutorService e = ForkJoinPool.commonPool() | |
| Future<String> f = e.submit(() -> "hello devfest") | |
| f.get() | |
| CompletableFuture<String> cf = new CompletableFuture<String>() |
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
| 1+1 | |
| int x = 1+1 | |
| System.out.println(x) | |
| Thread.sleep(2000) | |
| /vars | |
| /methods | |
| /types | |
| int inc(int x) { return x+1; } | |
| inc(4) | |
| class MyClass { static void hello() {System.out.println("hello geecon"); } } |
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
| 1+1 | |
| int x = 1+1 | |
| System.out.println(x) | |
| Thread.sleep(2000) | |
| /vars | |
| /methods | |
| /types | |
| /list | |
| /l | |
| /help |
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
| List<String> myList = new ArrayList<>() | |
| Supplier<String> helloSupplier = new Supplier<String>() { | |
| @Override | |
| public String get() { | |
| return "hello geecon"; | |
| } | |
| } |