Java 9: the good parts (not modules)
summary
Java 9 adds dozens of concrete conveniences and fixes rather than vague promises: factory methods List.of/Set.of/Map.of (maps limited to 10 overloads, Map.ofEntries beyond that), immutable List behavior versus Arrays.asList quirks, a null-coalescing helper Objects.requireNonNullElse, optional helpers like ifPresentOrElse and optional::stream with flatMap, I/O helpers readAllBytes/readNBytes/transferTo, Files.lines memory mapping, ProcessHandle.onExit returning a CompletableFuture, an incubating async HTTP client, and removal/deprecation of legacy APIs such as finalize and Class.newInstance.
AI-written summary · about
chapters (35)
- 0:00Introduction
- 0:24Collection literals
- 3:57Pop quiz on map literals
- 5:21Arrays vs List.of
- 8:10Missing Pair class
- 9:35Elvis operator in Java
- 10:40Optional improvements
- 13:28Optional cheat sheet
- 14:33Stream API enhancements
- 19:09Read all bytes from stream
- 20:57Scanner tokens stream
- 21:38Regex match results
- 23:25Process API updates
- 25:32HTTP client incubator
- 29:47Deprecated APIs
- 31:54Class.newInstance deprecated
- 32:57Underscore variable name
- 33:19Try with resources
- 34:00Interface private methods
- 35:04SafeVarargs on private methods
- 36:56Diamond operator in anonymous classes
- 37:59Obscure compiler fixes
- 39:25Interface method parameter 'this'
- 41:31Arrays.toList.toArray quirks
- 42:58Java version number quirks
- 44:03Multi-release JARs
- 45:26Command-line argument cleanup
- 47:52Modern Java options
- 49:17JShell features
- 51:04API docs search
- 51:25Resource files UTF-8
- 51:47JavaC output directories
- 52:07Java DB and Swing updates
- 52:51Illegal access warnings
- 53:13Summary and Q&A
