GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-new-features/java-16 at master · jhavierc/java-new-features

Expand file tree

/

java-16

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

java-16

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
RecordStaticInnerMemberTest.java
RecordStaticInnerMemberTest.java
 
 
SealedTypesExample.java
SealedTypesExample.java
 
 
UnixDomainSocketTest.java
UnixDomainSocketTest.java
 
 
ValueBasedClassWarnings.java
ValueBasedClassWarnings.java
 
 

README.md

Outline

Java 16

To run each example use: java --enable-preview --source 16 <FileName.java>

Features

Language

  • Pattern matching for instanceof (standard)
  • Record
    • now we can declare static class or a record in an inner class
  • Warnings for Value-Based Classes
    • starting the preparatives for Project Valhalla (can't wait for it to be fully implemented)
    • warning the using value-based classes in synchronization and flag to force an error (1) or log (2)
      • flag: -XX:DiagnoseSyncOnValueBasedClasses=1|2
    • starting with primitive wrappers (but soon might be expanded)
  • Foreign-Memory Access API
    • change in the API
  • Sealed classes (second preview)
    • sealed, non-sealed and permits became contextual keywords (we can use it as var name or method name)
  • Unix-Domain Socket Channels

JVM

  • Elastic Metaspace - allow JVM to return unused memory to OS
    • flag to customize: -XX:MetaspaceReclaimPolicy=balanced|aggressive|none
  • Packaging tool promoted to standard
    • changing only on flag: --bind-services to --jlink-options
  • Changed default flag for JDK internals:
    • now it is --illegal-access=deny

JEPs

  • 338 - Vector API (Incubator)
  • 347 - Enable C++14 Language Features
  • 357 - Migrate from Mercurial to Git
  • 369 - Migrate to GitHub
  • 376 - ZGC: Concurrent Thread-Stack Processing
  • 380 - Unix-Domain Socket Channels
  • 386 - Alpine Linux Port
  • 387 - Elastic Metaspace
  • 388 - Windows/AArch64 Port
  • 389 - Foreign Linker API (Incubator)
  • 390 - Warnings for Value-Based Classes
  • 392 - Packaging Tool
  • 393 - Foreign-Memory Access API (Third Incubator)
  • 394 - Pattern Matching for instanceof
  • 395 - Records
  • 396 - Strongly Encapsulate JDK Internals by Default
  • 397 - Sealed Classes (Second Preview)

Links

  • JDK 16 Jeps
  • Valhalla Project
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.