SlideShare a Scribd company logo
6
Most read
9
Most read
11
Most read
Java 17:
Features & implementation,
Chitra Singh (Senior Software Consultant)
Java Competency
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
 Punctuality
Join the session 5 minutes prior to the session start time. We start on
time and conclude on time!
 Feedback
Make sure to submit a constructive feedback for all sessions as it is very
helpful for the presenter.
 Silent Mode
Keep your mobile devices in silent mode, feel free to move out of session
in case you need to attend an urgent call.
 Avoid Disturbance
Avoid unwanted chit chat during the session.
• Introduction to Java 17
o Java 17 Overview
o Key Highlights
o Importance of Upgrading
• Key New Features in Java 17
o Pattern Matching for switch (Preview)
o Sealed Classes
o Enhanced Pseudo-Random Number Generators
o New Applet API Removal
o Context-Specific Deserialization Filters
o Foreign Function & Memory API (Incubator)
o Vector API (Second Incubator)
o Strong Encapsulation of JDK Internals by Default
o Deprecate and Disable Biased Locking
o macOS/AArch64 Port
• QnA
Introduction to Java 17
Java 17, released in September 2021, is a long-term support (LTS) release, which means it will receive extended support and
updates from Oracle. This makes it a significant version for businesses and developers who prefer stability and long-term
maintenance. Java 17 brings numerous enhancements, new features, and improvements that contribute to its performance,
security, and overall functionality.
 Java 17 Overview:
o Released in September 2021
o Long-Term Support (LTS) version, supported until 2029
o Successor to Java 11 LTS, following the 6-month release cadence
o Part of Oracle’s commitment to a predictable release schedule
 Key Highlights:
o Enhanced performance and stability
o Significant improvements in garbage collection and memory management
o Introduction of new language features and APIs
 Importance of Upgrading:
o Staying updated with the latest security patches and bug fixes
o Leveraging new features for more efficient and readable code
o Ensuring compatibility with modern libraries and frameworks
Benefits of Upgrading to Java 17
E
L
M
I
D
Enhanced Performance
Includes performance improvements and optimizations that lead to
better resource utilization and faster application execution
Modern Language Features
Features like sealed classes and pattern matching for switch
enhance code readability, expressiveness, and maintainability
Long-Term Support
Java 17 is an LTS release, ensuring extended support and
updates, making it a stable and reliable choice for production
environments
Improved Security
Strong encapsulation of JDK internals and context-specific
deserialization filters enhance application security by
reducing vulnerabilities
Developer Productivity
New APIs and language enhancements, such as the Vector
API and Foreign Function & Memory API, provide powerful
tools that increase developer efficiency and reduce
development time
Key New Features in Java 17
1. Pattern Matching for switch (Preview)
2. Sealed Classes
3. Enhanced Pseudo-Random Number
Generators
4. New Applet API Removal
5. Context-Specific Deserialization Filters
6. Foreign Function & Memory API (Incubator)
7. Vector API (Second Incubator)
8. Strong Encapsulation of JDK Internals by
Default
9. Deprecate and Disable Biased Locking
10. macOS/AArch64 Port
• A preview feature is a new feature of the Java language, Java
Virtual Machine, or Java SE API that is fully specified, fully
implemented, and yet impermanent. It is available in a JDK
feature release to provoke developer feedback based on real
world use; this may lead to it becoming permanent in a future
Java SE Platform.
• A final feature is a new feature of the Java language, Java
Virtual Machine, or Java SE API that is fully specified, fully
implemented, and permanent.
• Incubator modules are a means of putting non-final APIs and
non-final tools in the hands of developers, while the APIs/tools
progress towards either finalization or removal in a future
release.
Features in Java 17(Pattern Matching for switch [Preview] )
Pattern Matching for Switch (Preview)
Pattern Matching for switch is an enhancement in Java 17 that allows you to use patterns directly in switch
statements and expressions. This feature simplifies complex conditional logic and enhances code readability
and maintainability.
• Simplifies the syntax of complex switch statements
• Allows patterns to be used directly within switch statements and expressions
Benefits:
• More readable and concise code
• Enhanced type safety by ensuring that all cases are covered
• Reduces boilerplate code associated with type checks and casts
Features in Java 17(Pattern Matching for switch [Preview] )
Implementation of Pattern Matching for Switch (Preview)
Use Cases:
• Handling different types of objects in a collection
• Simplifying the processing logic based on the type of input
• Improving the clarity of conditional logic by reducing nested if-else statements
Features in Java 17 (Sealed Classes )
Sealed Classes
Sealed classes and interfaces are a powerful feature introduced in Java 17. They allow you to restrict which
classes or interfaces can extend or implement them. This feature provides a way to create a more controlled
and predictable class hierarchy.
• Restrict which other classes or interfaces may extend or implement them
• Enhance the modeling of class hierarchies and provide better control over inheritance
Benefits:
• Ensures a limited set of subclasses, which can be easier to manage and understand
• Improves code readability and maintainability by explicitly specifying permitted subclasses
• Enables more secure and reliable designs by preventing unintended extensions
Features in Java 17 (Sealed Classes )
Implementation of Sealed Classes
Use Cases:
• Defining a fixed set of types for a particular domain (e.g., different kinds of shapes, commands, etc.)
• Enhancing security by limiting which classes can extend a base class
• Providing a clear and enforced API for developers using the class
Features in Java 17 (Enhanced Pseudo-Random Number Generators )
Enhanced Pseudo-Random Number Generators
Java 17 introduces several enhancements and features related to random number generation, building upon the
existing java.util.Random and java.util.concurrent.ThreadLocalRandom classes. Here are some of the key
enhancements related to pseudo-random number generation in Java 17:
• New Interface: RandomGenerator Abstraction for different random number generators.
• SplittableRandom Implementation Efficient generation of random numbers across threads. It Supports various
algorithms and distributions.
• Enhanced SecureRandom Supports ThreadLocalRandom.current() for concurrency.
• Cryptographically strong randomness seeding.
• Control and Flexibility APIs Manage and configure random generators.
• Performance Improvements Enhanced algorithms for faster random number generation.
Features in Java 17 (Enhanced Pseudo-Random Number Generators )
Implementation of Enhanced Pseudo-Random Number Generators
Use Cases:
o Simulation: Accurate modeling of complex systems.
o Security: Cryptographic operations and secure communication protocols.
o Gaming: Random event generation in gaming applications.
o Analytics: Statistical analysis and data sampling.
Features in Java 17 (New Applet API Removal )
Deprecate the Applet API for Removal
In JDK 17, the Applet API is marked as deprecated for removal. It means that the JDK 18 will remove the API.The Applet
API removal is long overdue, considering that all browsers have either ended the support or have plans to do so. The
API had already been deprecated in JDK 9, but it had not been marked for removal.
• Applet API: Historically used for embedding Java applets in web browsers.
• Replacement: HTML5, JavaScript, and modern web technologies now fulfill similar functionalities.
Reasons:
• Security vulnerabilities
• Decreased usage
• Modern web standards led to this decision
Implications:
• End of Life: Applets are no longer supported for running in web browsers as of Java 11 and beyond.
• Transition: Developers and organizations must migrate existing applet-based applications to alternative technologies.
Features in Java 17 (Context-Specific Deserialization Filters )
Context-Specific Deserialization Filters
Context-Specific Deserialization Filters provide a mechanism to control and restrict the deserialization process of objects
based on contextual information. This is particularly useful in scenarios where deserialization of arbitrary objects from
untrusted sources could pose security risks.
Key Features:
• Filter Interface: java.io.ObjectInputFilter provides methods to control deserialization behavior.
• Contextual Criteria: Define filters based on caller class, code source, or specific attributes.
• Granular Control: Allows per-call, per-thread, or per-application filters.
Benefits:
• Security Enhancement: Prevents deserialization attacks by limiting allowed object types.
• Flexibility: Customize filters based on specific application requirements.
• Compatibility: Integrates with existing deserialization mechanisms in Java.
Features in Java 17 (Context-Specific Deserialization Filters )
Use Cases:
•Network Communication: Apply stricter filters for deserialization over network protocols.
•Sensitive Data Handling: Control deserialization in environments handling sensitive information.
•Third-Party Libraries: Protect against vulnerabilities in third-party library deserialization.
Implementation of Context-Specific Deserialization Filters
Features in Java 17 (Strong Encapsulation of JDK Internals by Default )
Strong Encapsulation of JDK Internals by Default
In Java 17, a significant enhancement was introduced regarding the strong encapsulation of JDK internals by default. This
change aims to improve the security and maintainability of Java applications by restricting direct access to internal APIs that
are not part of the public Java API specification.
• Access Restriction: Access to internal JDK classes and APIs (those in packages like sun.*, com.sun.*, jdk.internal.*, etc.) is restricted by
default. Attempting to access these APIs from code outside the JDK itself will result in compilation errors or runtime exceptions.
• Impact on Developers:
• Migration: Developers are required to migrate their code away from using internal APIs to public APIs or supported alternatives.
• Security: This change enhances the security of Java applications by reducing the attack surface exposed through potentially insecure
internal APIs.
• Maintainability: Encourages developers to write more robust and maintainable code by relying only on stable, documented public
APIs.
• Migration Strategies:
• Use Public APIs: Identify and use public APIs or alternative libraries that provide equivalent functionality.
• Module System: Utilize Java's module system (introduced in Java 9) to encapsulate internal implementations and expose only necessary public
interfaces.
• Compatibility: Use tools like the jdeps tool to analyze dependencies and identify usage of internal APIs that need migration.
Features in Java 17 (Strong Encapsulation of JDK Internals by Default )
Implementation of Strong Encapsulation of JDK Internals by Default
In Java 17, direct access to sun.misc.BASE64Encoder is restricted due to strong encapsulation of JDK internals. Therefore,
you should use the java.util.Base64 class from the standard Java API instead. Here's how you can rewrite your code using
java.util.Base64:
Features in Java 17 (Deprecate and Disable Biased Locking )
Deprecate and Disable Biased Locking:
Biased Locking Optimization for single-threaded access to locks.
As of Java 17, biased locking has already been deprecated and disabled in previous versions (Java 15 and 16).
Therefore, there are no additional changes or actions needed specifically for Java 17 regarding biased locking.
Why Deprecate and Disable?
• Performance considerations: Overhead in high-contention scenarios.
• Simplification of JVM internals: Enhances predictability and scalability.
• Deprecation (Java 15):Officially deprecated due to Increased complexity. Limited Simplify JVM internals for better
predictability and scalability.
• Disablement (Java 16) :Fully disabled to Remove overhead in high-contention scenarios. Simplify JVM internals for
better predictability and scalability.
Alternative Strategies:
• Adaptive spinning, lock elision: Modern JVM optimizations for concurrency.
• Ensures better performance across diverse workloads.
Features in Java 17 (macOS/AArch64 Port )
macOS/AArch64 Port
• Transition to Apple Silicon
• Apple Silicon: ARM-based processors (M1, M1 Pro, M1 Max) introduced by Apple for Macs.
• Performance: Improved power efficiency and performance compared to Intel x86.
• Java 17 Support
• Native Compilation: Java 17 supports AArch64 (ARM64) architecture natively.
• Compatibility: Ensures Java applications run efficiently on macOS devices with Apple Silicon.
• Development Ecosystem
• Xcode Integration: Java development using Xcode on macOS AArch64.
• Universal Binaries: Facilitates deployment of Java applications as universal binaries for both ARM and x86
architectures.
• Benefits
• Performance Boost: Native execution on Apple Silicon enhances Java application performance.
• Ecosystem Integration: Enables developers to leverage new hardware capabilities seamlessly.
Features in Java 17 (Foreign Function & Memory API (Incubator),Vector API (Second Incubator))
Foreign Function & Memory API (Incubator)
Facilitates seamless interaction with native code and efficient management of native memory directly from Java.
Key Features
• Native Library Interaction: Enables calling native functions directly from Java without JNI (Java Native Interface) overhead.
• Memory Access: Provides safe and efficient access to native memory regions from Java code.
• Type Safety: Ensures type safety when interacting with native data structures.
Vector API (Second Incubator)
The Vector API (Second Incubator) in Java 17 introduces a set of features aimed at enabling efficient SIMD (Single
Instruction, Multiple Data) programming in Java
Key Features
• SIMD Parallelism: Enables efficient parallel processing of data using vector operations.
• Performance: Enhances computational throughput for numerical and data-intensive tasks.
• Platform Support: Designed to leverage hardware SIMD support for optimized execution.
Java 17 features and implementation.pptx

More Related Content

PPT
Introduction to data structures and Algorithm
Dhaval Kaneria
 
PDF
The Rise of Forerunners | Accenture
accenture
 
PPTX
Data Structure and Algorithms.pptx
Syed Zaid Irshad
 
PPTX
Tailwind CSS.11.pptx
Harish Verma
 
PDF
Seminar on artificial intelligence
emojiemoji
 
PPT
Network programming in Java
Tushar B Kute
 
PDF
Java 17
Mutlu Okuducu
 
PPTX
MULTI THREADING IN JAVA
VINOTH R
 
Introduction to data structures and Algorithm
Dhaval Kaneria
 
The Rise of Forerunners | Accenture
accenture
 
Data Structure and Algorithms.pptx
Syed Zaid Irshad
 
Tailwind CSS.11.pptx
Harish Verma
 
Seminar on artificial intelligence
emojiemoji
 
Network programming in Java
Tushar B Kute
 
Java 17
Mutlu Okuducu
 
MULTI THREADING IN JAVA
VINOTH R
 

What's hot (20)

PDF
An Introduction to the WSO2 API Manager
WSO2
 
PDF
Java11 New Features
Haim Michael
 
PDF
Java 8 features
NexThoughts Technologies
 
PDF
Introduction to Java 11
Knoldus Inc.
 
PDF
An Introduction to Gradle for Java Developers
Kostas Saidis
 
PPT
Top java script frameworks ppt
Omkarsoft Bangalore
 
PDF
The New JavaScript: ES6
Rob Eisenberg
 
PDF
Angular - Chapter 1 - Introduction
WebStackAcademy
 
PPTX
Gradle
Jadson Santos
 
PPTX
Java 8 - Features Overview
Sergii Stets
 
PPTX
Spring Boot
Jiayun Zhou
 
PPTX
Java GC
Ray Cheng
 
PPTX
Introduction to GraphQL
Bhargav Anadkat
 
PDF
Java 8 Workshop
Mario Fusco
 
KEY
Non blocking io with netty
Zauber
 
PPTX
Java Spring Framework
Mehul Jariwala
 
ODP
Java 9 Features
NexThoughts Technologies
 
PPTX
Spring boot
Pradeep Shanmugam
 
PDF
Spring Boot
HongSeong Jeon
 
An Introduction to the WSO2 API Manager
WSO2
 
Java11 New Features
Haim Michael
 
Java 8 features
NexThoughts Technologies
 
Introduction to Java 11
Knoldus Inc.
 
An Introduction to Gradle for Java Developers
Kostas Saidis
 
Top java script frameworks ppt
Omkarsoft Bangalore
 
The New JavaScript: ES6
Rob Eisenberg
 
Angular - Chapter 1 - Introduction
WebStackAcademy
 
Java 8 - Features Overview
Sergii Stets
 
Spring Boot
Jiayun Zhou
 
Java GC
Ray Cheng
 
Introduction to GraphQL
Bhargav Anadkat
 
Java 8 Workshop
Mario Fusco
 
Non blocking io with netty
Zauber
 
Java Spring Framework
Mehul Jariwala
 
Java 9 Features
NexThoughts Technologies
 
Spring boot
Pradeep Shanmugam
 
Spring Boot
HongSeong Jeon
 
Ad

Similar to Java 17 features and implementation.pptx (20)

PPTX
What are the key features of Java 17, and how does it differ from previous ve...
xploreitcorp
 
PDF
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
GlobalLogic Ukraine
 
PPTX
Java dev mar_2021_keynote
Suyash Joshi
 
PDF
What's New in IBM Java 8 SE?
Tim Ellison
 
PPT
What is Java Technology (An introduction with comparision of .net coding)
Shaharyar khan
 
PDF
Java programming and security
UmeshchandraYadav5
 
PPTX
Java se7 features
Kumaraswamy M
 
PPT
Apache Tomcat 7 by Filip Hanik
Edgar Espina
 
PDF
JDK 10 Java Module System
Wolfgang Weigend
 
PDF
Java 8 in Anger, Devoxx France
Trisha Gee
 
PDF
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
Buhake Sindi
 
PPTX
.net Framework
Rishu Mehra
 
PDF
Java 8 in Anger (QCon London)
Trisha Gee
 
PDF
JDK 8 and JDK 8 Updates in OpenJDK
Wolfgang Weigend
 
PPTX
5 Treding Java Frameworks Offshore Developers Should About
BJIT Ltd
 
PPTX
Babel.pptx
Parham Abolghasemi
 
DOC
Java 5
mannut2001
 
PPT
2-Lec - History of OOP and Java (1) .ppt
AqeelAbbas94
 
PDF
FFM / Panama: A case study with OpenSSL and Tomcat
Jean-Frederic Clere
 
PDF
Introducing Java 8
PT.JUG
 
What are the key features of Java 17, and how does it differ from previous ve...
xploreitcorp
 
Java Webinar #12: "Java Versions and Features: Since JDK 8 to 16"
GlobalLogic Ukraine
 
Java dev mar_2021_keynote
Suyash Joshi
 
What's New in IBM Java 8 SE?
Tim Ellison
 
What is Java Technology (An introduction with comparision of .net coding)
Shaharyar khan
 
Java programming and security
UmeshchandraYadav5
 
Java se7 features
Kumaraswamy M
 
Apache Tomcat 7 by Filip Hanik
Edgar Espina
 
JDK 10 Java Module System
Wolfgang Weigend
 
Java 8 in Anger, Devoxx France
Trisha Gee
 
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
Buhake Sindi
 
.net Framework
Rishu Mehra
 
Java 8 in Anger (QCon London)
Trisha Gee
 
JDK 8 and JDK 8 Updates in OpenJDK
Wolfgang Weigend
 
5 Treding Java Frameworks Offshore Developers Should About
BJIT Ltd
 
Babel.pptx
Parham Abolghasemi
 
Java 5
mannut2001
 
2-Lec - History of OOP and Java (1) .ppt
AqeelAbbas94
 
FFM / Panama: A case study with OpenSSL and Tomcat
Jean-Frederic Clere
 
Introducing Java 8
PT.JUG
 
Ad

More from Knoldus Inc. (20)

PPTX
Angular Hydration Presentation (FrontEnd)
Knoldus Inc.
 
PPTX
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Knoldus Inc.
 
PPTX
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
PPTX
Kanban Metrics Presentation (Project Management)
Knoldus Inc.
 
PPTX
Chaos Mesh Introducing Chaos in Kubernetes
Knoldus Inc.
 
PPTX
GraalVM - A Step Ahead of JVM Presentation
Knoldus Inc.
 
PPTX
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
PPTX
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
PPTX
DAPR - Distributed Application Runtime Presentation
Knoldus Inc.
 
PPTX
Introduction to Azure Virtual WAN Presentation
Knoldus Inc.
 
PPTX
Introduction to Argo Rollouts Presentation
Knoldus Inc.
 
PPTX
Intro to Azure Container App Presentation
Knoldus Inc.
 
PPTX
Insights Unveiled Test Reporting and Observability Excellence
Knoldus Inc.
 
PPTX
Introduction to Splunk Presentation (DevOps)
Knoldus Inc.
 
PPTX
Code Camp - Data Profiling and Quality Analysis Framework
Knoldus Inc.
 
PPTX
AWS: Messaging Services in AWS Presentation
Knoldus Inc.
 
PPTX
Amazon Cognito: A Primer on Authentication and Authorization
Knoldus Inc.
 
PPTX
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Knoldus Inc.
 
PPTX
Managing State & HTTP Requests In Ionic.
Knoldus Inc.
 
PPTX
Facilitation Skills - When to Use and Why.pptx
Knoldus Inc.
 
Angular Hydration Presentation (FrontEnd)
Knoldus Inc.
 
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Knoldus Inc.
 
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
Kanban Metrics Presentation (Project Management)
Knoldus Inc.
 
Chaos Mesh Introducing Chaos in Kubernetes
Knoldus Inc.
 
GraalVM - A Step Ahead of JVM Presentation
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
DAPR - Distributed Application Runtime Presentation
Knoldus Inc.
 
Introduction to Azure Virtual WAN Presentation
Knoldus Inc.
 
Introduction to Argo Rollouts Presentation
Knoldus Inc.
 
Intro to Azure Container App Presentation
Knoldus Inc.
 
Insights Unveiled Test Reporting and Observability Excellence
Knoldus Inc.
 
Introduction to Splunk Presentation (DevOps)
Knoldus Inc.
 
Code Camp - Data Profiling and Quality Analysis Framework
Knoldus Inc.
 
AWS: Messaging Services in AWS Presentation
Knoldus Inc.
 
Amazon Cognito: A Primer on Authentication and Authorization
Knoldus Inc.
 
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Knoldus Inc.
 
Managing State & HTTP Requests In Ionic.
Knoldus Inc.
 
Facilitation Skills - When to Use and Why.pptx
Knoldus Inc.
 

Recently uploaded (20)

PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
The Future of Artificial Intelligence (AI)
Mukul
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Software Development Methodologies in 2025
KodekX
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 

Java 17 features and implementation.pptx

  • 1. Java 17: Features & implementation, Chitra Singh (Senior Software Consultant) Java Competency
  • 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes  Punctuality Join the session 5 minutes prior to the session start time. We start on time and conclude on time!  Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter.  Silent Mode Keep your mobile devices in silent mode, feel free to move out of session in case you need to attend an urgent call.  Avoid Disturbance Avoid unwanted chit chat during the session.
  • 3. • Introduction to Java 17 o Java 17 Overview o Key Highlights o Importance of Upgrading • Key New Features in Java 17 o Pattern Matching for switch (Preview) o Sealed Classes o Enhanced Pseudo-Random Number Generators o New Applet API Removal o Context-Specific Deserialization Filters o Foreign Function & Memory API (Incubator) o Vector API (Second Incubator) o Strong Encapsulation of JDK Internals by Default o Deprecate and Disable Biased Locking o macOS/AArch64 Port • QnA
  • 4. Introduction to Java 17 Java 17, released in September 2021, is a long-term support (LTS) release, which means it will receive extended support and updates from Oracle. This makes it a significant version for businesses and developers who prefer stability and long-term maintenance. Java 17 brings numerous enhancements, new features, and improvements that contribute to its performance, security, and overall functionality.  Java 17 Overview: o Released in September 2021 o Long-Term Support (LTS) version, supported until 2029 o Successor to Java 11 LTS, following the 6-month release cadence o Part of Oracle’s commitment to a predictable release schedule  Key Highlights: o Enhanced performance and stability o Significant improvements in garbage collection and memory management o Introduction of new language features and APIs  Importance of Upgrading: o Staying updated with the latest security patches and bug fixes o Leveraging new features for more efficient and readable code o Ensuring compatibility with modern libraries and frameworks
  • 5. Benefits of Upgrading to Java 17 E L M I D Enhanced Performance Includes performance improvements and optimizations that lead to better resource utilization and faster application execution Modern Language Features Features like sealed classes and pattern matching for switch enhance code readability, expressiveness, and maintainability Long-Term Support Java 17 is an LTS release, ensuring extended support and updates, making it a stable and reliable choice for production environments Improved Security Strong encapsulation of JDK internals and context-specific deserialization filters enhance application security by reducing vulnerabilities Developer Productivity New APIs and language enhancements, such as the Vector API and Foreign Function & Memory API, provide powerful tools that increase developer efficiency and reduce development time
  • 6. Key New Features in Java 17 1. Pattern Matching for switch (Preview) 2. Sealed Classes 3. Enhanced Pseudo-Random Number Generators 4. New Applet API Removal 5. Context-Specific Deserialization Filters 6. Foreign Function & Memory API (Incubator) 7. Vector API (Second Incubator) 8. Strong Encapsulation of JDK Internals by Default 9. Deprecate and Disable Biased Locking 10. macOS/AArch64 Port • A preview feature is a new feature of the Java language, Java Virtual Machine, or Java SE API that is fully specified, fully implemented, and yet impermanent. It is available in a JDK feature release to provoke developer feedback based on real world use; this may lead to it becoming permanent in a future Java SE Platform. • A final feature is a new feature of the Java language, Java Virtual Machine, or Java SE API that is fully specified, fully implemented, and permanent. • Incubator modules are a means of putting non-final APIs and non-final tools in the hands of developers, while the APIs/tools progress towards either finalization or removal in a future release.
  • 7. Features in Java 17(Pattern Matching for switch [Preview] ) Pattern Matching for Switch (Preview) Pattern Matching for switch is an enhancement in Java 17 that allows you to use patterns directly in switch statements and expressions. This feature simplifies complex conditional logic and enhances code readability and maintainability. • Simplifies the syntax of complex switch statements • Allows patterns to be used directly within switch statements and expressions Benefits: • More readable and concise code • Enhanced type safety by ensuring that all cases are covered • Reduces boilerplate code associated with type checks and casts
  • 8. Features in Java 17(Pattern Matching for switch [Preview] ) Implementation of Pattern Matching for Switch (Preview) Use Cases: • Handling different types of objects in a collection • Simplifying the processing logic based on the type of input • Improving the clarity of conditional logic by reducing nested if-else statements
  • 9. Features in Java 17 (Sealed Classes ) Sealed Classes Sealed classes and interfaces are a powerful feature introduced in Java 17. They allow you to restrict which classes or interfaces can extend or implement them. This feature provides a way to create a more controlled and predictable class hierarchy. • Restrict which other classes or interfaces may extend or implement them • Enhance the modeling of class hierarchies and provide better control over inheritance Benefits: • Ensures a limited set of subclasses, which can be easier to manage and understand • Improves code readability and maintainability by explicitly specifying permitted subclasses • Enables more secure and reliable designs by preventing unintended extensions
  • 10. Features in Java 17 (Sealed Classes ) Implementation of Sealed Classes Use Cases: • Defining a fixed set of types for a particular domain (e.g., different kinds of shapes, commands, etc.) • Enhancing security by limiting which classes can extend a base class • Providing a clear and enforced API for developers using the class
  • 11. Features in Java 17 (Enhanced Pseudo-Random Number Generators ) Enhanced Pseudo-Random Number Generators Java 17 introduces several enhancements and features related to random number generation, building upon the existing java.util.Random and java.util.concurrent.ThreadLocalRandom classes. Here are some of the key enhancements related to pseudo-random number generation in Java 17: • New Interface: RandomGenerator Abstraction for different random number generators. • SplittableRandom Implementation Efficient generation of random numbers across threads. It Supports various algorithms and distributions. • Enhanced SecureRandom Supports ThreadLocalRandom.current() for concurrency. • Cryptographically strong randomness seeding. • Control and Flexibility APIs Manage and configure random generators. • Performance Improvements Enhanced algorithms for faster random number generation.
  • 12. Features in Java 17 (Enhanced Pseudo-Random Number Generators ) Implementation of Enhanced Pseudo-Random Number Generators Use Cases: o Simulation: Accurate modeling of complex systems. o Security: Cryptographic operations and secure communication protocols. o Gaming: Random event generation in gaming applications. o Analytics: Statistical analysis and data sampling.
  • 13. Features in Java 17 (New Applet API Removal ) Deprecate the Applet API for Removal In JDK 17, the Applet API is marked as deprecated for removal. It means that the JDK 18 will remove the API.The Applet API removal is long overdue, considering that all browsers have either ended the support or have plans to do so. The API had already been deprecated in JDK 9, but it had not been marked for removal. • Applet API: Historically used for embedding Java applets in web browsers. • Replacement: HTML5, JavaScript, and modern web technologies now fulfill similar functionalities. Reasons: • Security vulnerabilities • Decreased usage • Modern web standards led to this decision Implications: • End of Life: Applets are no longer supported for running in web browsers as of Java 11 and beyond. • Transition: Developers and organizations must migrate existing applet-based applications to alternative technologies.
  • 14. Features in Java 17 (Context-Specific Deserialization Filters ) Context-Specific Deserialization Filters Context-Specific Deserialization Filters provide a mechanism to control and restrict the deserialization process of objects based on contextual information. This is particularly useful in scenarios where deserialization of arbitrary objects from untrusted sources could pose security risks. Key Features: • Filter Interface: java.io.ObjectInputFilter provides methods to control deserialization behavior. • Contextual Criteria: Define filters based on caller class, code source, or specific attributes. • Granular Control: Allows per-call, per-thread, or per-application filters. Benefits: • Security Enhancement: Prevents deserialization attacks by limiting allowed object types. • Flexibility: Customize filters based on specific application requirements. • Compatibility: Integrates with existing deserialization mechanisms in Java.
  • 15. Features in Java 17 (Context-Specific Deserialization Filters ) Use Cases: •Network Communication: Apply stricter filters for deserialization over network protocols. •Sensitive Data Handling: Control deserialization in environments handling sensitive information. •Third-Party Libraries: Protect against vulnerabilities in third-party library deserialization. Implementation of Context-Specific Deserialization Filters
  • 16. Features in Java 17 (Strong Encapsulation of JDK Internals by Default ) Strong Encapsulation of JDK Internals by Default In Java 17, a significant enhancement was introduced regarding the strong encapsulation of JDK internals by default. This change aims to improve the security and maintainability of Java applications by restricting direct access to internal APIs that are not part of the public Java API specification. • Access Restriction: Access to internal JDK classes and APIs (those in packages like sun.*, com.sun.*, jdk.internal.*, etc.) is restricted by default. Attempting to access these APIs from code outside the JDK itself will result in compilation errors or runtime exceptions. • Impact on Developers: • Migration: Developers are required to migrate their code away from using internal APIs to public APIs or supported alternatives. • Security: This change enhances the security of Java applications by reducing the attack surface exposed through potentially insecure internal APIs. • Maintainability: Encourages developers to write more robust and maintainable code by relying only on stable, documented public APIs. • Migration Strategies: • Use Public APIs: Identify and use public APIs or alternative libraries that provide equivalent functionality. • Module System: Utilize Java's module system (introduced in Java 9) to encapsulate internal implementations and expose only necessary public interfaces. • Compatibility: Use tools like the jdeps tool to analyze dependencies and identify usage of internal APIs that need migration.
  • 17. Features in Java 17 (Strong Encapsulation of JDK Internals by Default ) Implementation of Strong Encapsulation of JDK Internals by Default In Java 17, direct access to sun.misc.BASE64Encoder is restricted due to strong encapsulation of JDK internals. Therefore, you should use the java.util.Base64 class from the standard Java API instead. Here's how you can rewrite your code using java.util.Base64:
  • 18. Features in Java 17 (Deprecate and Disable Biased Locking ) Deprecate and Disable Biased Locking: Biased Locking Optimization for single-threaded access to locks. As of Java 17, biased locking has already been deprecated and disabled in previous versions (Java 15 and 16). Therefore, there are no additional changes or actions needed specifically for Java 17 regarding biased locking. Why Deprecate and Disable? • Performance considerations: Overhead in high-contention scenarios. • Simplification of JVM internals: Enhances predictability and scalability. • Deprecation (Java 15):Officially deprecated due to Increased complexity. Limited Simplify JVM internals for better predictability and scalability. • Disablement (Java 16) :Fully disabled to Remove overhead in high-contention scenarios. Simplify JVM internals for better predictability and scalability. Alternative Strategies: • Adaptive spinning, lock elision: Modern JVM optimizations for concurrency. • Ensures better performance across diverse workloads.
  • 19. Features in Java 17 (macOS/AArch64 Port ) macOS/AArch64 Port • Transition to Apple Silicon • Apple Silicon: ARM-based processors (M1, M1 Pro, M1 Max) introduced by Apple for Macs. • Performance: Improved power efficiency and performance compared to Intel x86. • Java 17 Support • Native Compilation: Java 17 supports AArch64 (ARM64) architecture natively. • Compatibility: Ensures Java applications run efficiently on macOS devices with Apple Silicon. • Development Ecosystem • Xcode Integration: Java development using Xcode on macOS AArch64. • Universal Binaries: Facilitates deployment of Java applications as universal binaries for both ARM and x86 architectures. • Benefits • Performance Boost: Native execution on Apple Silicon enhances Java application performance. • Ecosystem Integration: Enables developers to leverage new hardware capabilities seamlessly.
  • 20. Features in Java 17 (Foreign Function & Memory API (Incubator),Vector API (Second Incubator)) Foreign Function & Memory API (Incubator) Facilitates seamless interaction with native code and efficient management of native memory directly from Java. Key Features • Native Library Interaction: Enables calling native functions directly from Java without JNI (Java Native Interface) overhead. • Memory Access: Provides safe and efficient access to native memory regions from Java code. • Type Safety: Ensures type safety when interacting with native data structures. Vector API (Second Incubator) The Vector API (Second Incubator) in Java 17 introduces a set of features aimed at enabling efficient SIMD (Single Instruction, Multiple Data) programming in Java Key Features • SIMD Parallelism: Enables efficient parallel processing of data using vector operations. • Performance: Enhances computational throughput for numerical and data-intensive tasks. • Platform Support: Designed to leverage hardware SIMD support for optimized execution.