this post was submitted on 17 Jun 2024
20 points (85.7% liked)

Programming

17318 readers
33 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

A list of major Java and JVM features since JDK 17 to 22,

New language features JEP-409: Sealed Classes (17) JEP-440: Record patterns (21) JEP-441: Pattern matching for switch (21) JEP 456: Unnamed Variables & Patterns (22)

API changes JEP-306: Restore Always-Strict Floating-Point Semantics(17) JEP-382: New macOS Rendering Pipeline(17) JEP-400: UTF-8 by Default (18) JDK-8301226 – Clamp method for java.lang.(Strict)Math (21) JEP-439: Generational ZGC JEP-444: Virtual threads (21) JEP-454: Foreign Function & Memory(FFM) API (22)

Security JEP-452: Key Encapsulation Mechanism API (21) JDK-8275252: keystore file Features JEP-408: Simple web server (18) JEP-423: Region pinning for G1 (22) JEP-458: multi-file source-code programs (22) JEP-423: Region pinning for G1 (22) JEP-458: multi-file source-code programs (22)

Documentation JEP-413: Javadoc code snippets (18)

Deprecations

Lookahead Scoped values + Structured concurrency Module import declarations

top 5 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 4 months ago (1 children)

There seems like there is a copy and paste error where JEP-458 begins and then goes back to the content of JEP-408. (In case OP is the author/editor.)

[–] [email protected] 1 points 3 months ago

Thanks - will fix:)

[–] [email protected] 2 points 4 months ago (1 children)

JEP-400: UTF-8 by Default (18)

Wow, I always thought Java had been UTF-8 by default since v6 or something.

JEP-441: Pattern matching for switch (21)

Python got it too!

JEP-440: Record patterns (21)

Is this the easy replacement of "beans"?

JEP-409: Sealed Classes (17)

Huh? Haven't classes had final forever?

Anti Commercial-AI license

[–] [email protected] 6 points 4 months ago (1 children)

final prevents a class from being extended completely, while a sealed class is only extensible by a select few subclasses, which are explicitly defined in a permits clause in the sealed superclass

[–] [email protected] 1 points 4 months ago

Permits is only required when the compiler can't see the extending classes. IE inner classes can extend without needing to be written out in a permits clause. This isn't really that useful but I've taken advantage of it more than once so who knows