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

  • onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 months ago

    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

    • Kport@feddit.de
      link
      fedilink
      arrow-up
      6
      ·
      5 months ago

      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

      • Traister101@lemmy.today
        link
        fedilink
        arrow-up
        1
        ·
        5 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

  • JackbyDev@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 months ago

    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.)