boolean bool = switch (ternaryBool) {
case TRUE -> true;
case FALSE -> false;
case FILE_NOT_FOUND -> throw
new FileNotFoundException("🤬");
};
The plan for today:
start with a Java 11 code base
take it all the way to Java 15
(and beyond)
be amazed by how much changes
This talk is:
a showcase, not a tutorial
not a complete list
created with the lavish help
of the people in Twitch chat
slides at slides.codefx.org
code at github.com/CodeFx-org
demo code base: /java-after-eight
more Java 9+ features: /demo-java-x
released 09/2018
free support by Oracle ended 01/2019
free support by Red Hat until 10/2024
more free and commercial support available
first "modern" Java release with LTS
solid feature set
stable
great support
Java 11 misses out on many recent developments:
thrilling new language features
some improved APIs
a few new JVM features
improved performance
Let me show you how much
you’re missing out on
if you’re (still?) on Java 11.
Code, code, code, code
release 03/2019
support ended 07/2019
more powerful collections | Collectors::teeing
better async error handling | ↴
CompletableFuture::exceptionallyCompose
transforming Strings | ↴
String.transform(Function<String, R>)
social media number format | ↴
NumberFormat::getCompactNumberInstance
easy file comparison | Files::mismatch
included JDK CDS archive
released 09/2019
free support ended 01/2020
commercial support available by Azul
automatic application CDS archive
release 03/2020
support ends 07/2020
switch expressions | ↴
boolean bool = switch (ternaryBool) {
case TRUE -> true;
case FALSE -> false;
case FILE_NOT_FOUND -> throw
new FileNotFoundException("🤬");
};
helpful NPE messages
standardized foreign-memory access
JFR event streaming
OS-specific installers | jpackage
released today
support ends 01/2021
text blocks | ↴
var recommendation = """
{
"title": '$TITLE',
"recommendations": $RECS
}
""";
obvious String
formattting | String::format
hidden classes
some features are already in preview
more are on the horizon
records | record Title(String text)
pattern matching | o instanceof Article a
sealed clases | sealed class … permits
concise method bodies | Project Amber
inline classes | Project Valhalla
fibers | Project Loom
more expressive code | LOC: 2058 📉 1587
faster code | run time: ~ 1 s 📈 ~ 1.1 s 😞
better JVM | MR-JARs, GCs, packaging, monitoring, etc.
Sure you don’t want to upgrade?
💻 codefx.org
🐦 @nipafx
Slides at slides.codefx.org
⇜ Get my book!
You can hire me:
training (Java 8-14, JUnit 5)
consulting (Java 8-14)