โ AOT class preloading
Cache class loading and compilation for instant startup.
Cold Start Every Time โ AOT Cache (JDK 25+)
๐ https://t.co/xtrzfZdIcf
#Java#JavaEvolved
โ Diamond with anonymous classes
Diamond operator now works with anonymous classes too.
Repeat Type Args โ Diamond <> (JDK 9+)
๐ https://t.co/mT9PQWvFcE
#Java#JavaEvolved
โ Record-based error responses
Use records for concise, immutable error response types.
Map or Verbose Class โ Error Records (JDK 16+)
๐ https://t.co/2anhgnshLH
#Java#JavaEvolved
โ Switch expressions
Switch as an expression that returns a value โ no break, no fall-through.
Switch Statement โ Switch Expression (JDK 14+)
๐ https://t.co/g3FPDVnHJp
#Java#JavaEvolved
โ JUnit 6 with JSpecify null safety
JUnit 6 adopts JSpecify @NullMarked, making null contracts explicit across its assertion API.
Unannotated API โ @NullMarked API (JDK 17+)
๐ https://t.co/QVpNR1Jqfe
#Java#JavaEvolved
โ Text blocks for multiline strings
Write multiline strings naturally with triple-quote text blocks.
String Concatenation โ Text Blocks (JDK 15+)
๐ https://t.co/ozRDnGbumI
#Java#JavaEvolved
โ Primitive types in patterns
Pattern matching now works with primitive types, not just objects.
Manual Range Checks โ Primitive Patterns (JDK 25+)
๐ https://t.co/h3s91hWiE2
#Java#JavaEvolved
โ Instant with nanosecond precision
Get timestamps with microsecond or nanosecond precision.
Milliseconds โ Nanoseconds (JDK 9+)
๐ https://t.co/GUan38y34T
#Java#JavaEvolved
โ Null case in switch
Handle null directly as a switch case โ no separate guard needed.
Guard Before Switch โ case null (JDK 21+)
๐ https://t.co/TcQndtXOhs
#Java#JavaEvolved
โ Unmodifiable collectors
Collect directly to an unmodifiable list with stream.toList().
collectingAndThen โ stream.toList() (JDK 16+)
๐ https://t.co/TFzqYxelL3
#Java#JavaEvolved
โ Path.of() factory
Use Path.of() โ the modern factory method on the Path interface.
Paths.get() โ Path.of() (JDK 11+)
๐ https://t.co/jBnqyIgELv
#Java#JavaEvolved
โ Optional.orElseThrow() without supplier
Use Optional.orElseThrow() as a clearer, intent-revealing alternative to get().
get() or orElseThrow(supplier) โ orElseThrow() (JDK 10+)
๐ https://t.co/8pK34mT2Rn
#Java#JavaEvolved