Giter VIP home page Giter VIP logo

java22's Introduction

Java CI

Schedule

  • 2024/02/22 Final Release Candidate
  • 2024/03/19 General Availability

Java 22 Features

  • JEP 423: Region Pinning for G1
    • Reduce latency by implementing region pinning in G1, so that garbage collection need not be disabled during Java Native Interface (JNI) critical regions.
  • JEP 447: Statements before super(...) (Preview)
    • In constructors in the Java programming language, allow statements that do not reference the instance being created to appear before an explicit constructor invocation.
    • see example StatementsBeforeSuper.java
  • JEP 454: Foreign Function & Memory API
    • Introduce an API by which Java programs can interoperate with code and data outside of the Java runtime. Combination of 2 APIs introduced in previous JDKs:
    • Foreign-Memory Access API (incubator in 14, 15 and 16)
    • Foreign Linker API (incubator in 16)
    • The main changes since the 3rd preview are:
      • Provided a new linker option allowing clients to pass heap segments to downcall method handles;
      • Introduced the Enable-Native-Access JAR-file manifest attribute, allowing code in executable JAR files to call restricted methods without having to use the --enable-native-access command-line option;
      • Enabled clients to build C-language function descriptors programmatically, avoiding platform-specific constants;
      • Improved support for variable-length arrays in native memory; and Added support for arbitrary charsets for native strings.
    • see example ForeignFunctionAndMemoryAPI.java
  • JEP 456: Unnamed Variables & Patterns
    • Support unnamed variables and unnamed patterns. They can be use when variable declarations or nested patterns are required but never used. Both are denoted by the underscore character, _.
    • see example UnnamedVariablesAndPatterns.java
  • JEP 457: Class-File API (Preview)
    • Provide a standard API for parsing, generating, and transforming Java class files.
    • see example ClassFileAPI.java
  • JEP 458: Launch Multi-File Source-Code Programs
    • Enhance the java application launcher to be able to run a program supplied as multiple files of Java source code.
    • see example LaunchMultiFileSourceCodePrograms.java
  • JEP 459: String Templates (Second Preview)
    • String templates complement Java's existing string literals and text blocks by coupling literal text with embedded expressions and template processors to produce specialized results.
    • Except for a technical change in the types of template expressions, there are no changes relative to the first preview
    • see example StringTemplates.java
  • JEP 460: Vector API (Seventh Incubator)
    • Introduce an API to express vector computations that reliably compile at runtime to optimal vector instructions on supported CPU architectures, thus achieving performance superior to equivalent scalar computations.
    • Notable changes since 6th incubator:
      • Support vector access with heap MemorySegments that are backed by an array of any primitive element type. Previously access was limited to heap MemorySegments backed by an array of byte.
  • JEP 461: Stream Gatherers (Preview)
    • Enhance the Stream API to support custom intermediate operations. This will allow stream pipelines to transform data in ways that are not easily achievable with the existing built-in intermediate operations.
    • See example StreamGatherers.java
  • JEP 462: Structured Concurrency (Second Preview)
    • Simplify concurrent programming by introducing an API for structured concurrency. Structured concurrency treats groups of related tasks running in different threads as a single unit of work, thereby streamlining error handling and cancellation, improving reliability, and enhancing observability.
    • no changes since last preview in JDK 21.
    • see example StructuredConcurrency.java
  • JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)
    • Evolve the Java language so that students can write their first programs without needing to understand language features designed for large programs. Far from using a separate dialect of Java, students can write streamlined declarations for single-class programs and then seamlessly expand their programs to use more advanced features as their skills grow.
    • changes since first preview in JDK 21:
      • A source file without an enclosing class declaration is said to implicitly declare a class with a name chosen by the host system. Such implicitly declared classes behave like normal top-level classes and require no additional tooling, library, or runtime support.
      • simplify the selection process for the main method.
    • see example UnnamedClasses.java
  • JEP 464: Scoped Values (Second Preview)
    • Enable the sharing of immutable data within and across threads. They are preferred to thread-local variables, especially when using large numbers of virtual threads.
    • Unlike a thread-local variable, a scoped value is written once and is then immutable, and is available only for a bounded period during execution of the thread.
    • In effect, a scoped value is an implicit method parameter. It is "as if" every method in a sequence of calls has an additional, invisible, parameter. None of the methods declare this parameter and only the methods that have access to the scoped value object can access its value (the data). Scoped values make it possible to pass data securely from a caller to a faraway callee through a sequence of intermediate methods that do not declare a parameter for the data and have no access to the data.
    • no changes since the first preview in JDK 21.
    • see example ScopedValueServer.java

Other References

java22's People

Contributors

xtermi2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.