SlideShare a Scribd company logo
1 of 29
Download to read offline
What is new in Java 15
Haim Michael
April 12th
, 2021
All logos, trade marks and brand names used in this presentation belong
to the respective owners.
life
michae
l
Let's be on The Edge
www.lifemichael.com
© 2008 Haim Michael 20150805
XtremePython Conference
https://xtremepython.dev
© 2008 Haim Michael 20150805
XtremeJS Conference
https://xtremejs.dev
© 2008 Haim Michael 20150805
Courses on Udemy
https://www.udemy.com/user/life-michael/
© 2008 Haim Michael 20150805
Online Courses in Hebrew
Https://academy.lifemichael.com
© 2008 Haim Michael 20150805
Online Courses for Kids
http://kids.lifemichael.com
© 2008 Haim Michael 20150805
Premium Training Services
https://lifemichael.com
© 2008 Haim Michael 20150805
Scala Fundamentals Course
http://scala.course.lifemichael.com
© 2008 Haim Michael 20150805
Kotlin Fundamentals Course
http://kotlin.course.lifemichael.com
© 2008 Haim Michael 20150805
Functional Programming in Java
http://functional.java.seminar.lifemichael.com/
© 2008 Haim Michael 20150805
Table of Contents
 We are going to cover the following topics:
The JEP Process
Records
Sealed Classes
Hidden Classes
Patterns Matching
Foreign Memory Access
The ZGC JVM
The Shenandoah
Text Blocks
© 2008 Haim Michael 20150805
The JEP Process (JEP 0)
 The JEP process is the process of collecting, reviewing,
sorting and recording the results of proposals for the
enhancement of the JDK, and for related efforts.
 JEP stands for Java Enhancement Proposal. The JEP
process is defined by JEP 1.
https://openjdk.java.net/jeps
© 2008 Haim Michael 20150805
Records (JEP 384)
 The record is a new type of class. Using the 'record' keyword
(instead of 'class') we can easily create immutable data
objects.
public record Product(String name, int id) {
}
© 2008 Haim Michael 20150805
Records (JEP 384)
 The compiler infers which private instance variable should be
declared and auto generates toString, equals and
hashCode accordingly.
© 2008 Haim Michael 20150805
Records (JEP 384)
 We can add the definition for a constructor with validation
tests.
public record Product(String name, int id) {
public Product {
if(id<=0) {
//...
}
}
}
© 2008 Haim Michael 20150805
Records (JEP 384)
 The record we define is implicitly final, it cannot use native
methods and it cannot be declared abstract.
© 2008 Haim Michael 20150805
Sealed Classes (JEP 360)
 When defining a class as a sealed one we gain clear control
over the inheritance.
 In order to define a class as a sealed one we should add the
sealed keyword to the class definition. In addition, we should
add the permits keyword in order to specify which classes
can extend our sealed class.
 The class that extends a sealed class must be declared as a
sealed, non-sealed, or final.
© 2008 Haim Michael 20150805
Sealed Classes (JEP 360)
public sealed class Car permits SportCar, Bus {
//...
}
public final class Bus extends Car {
//...
}
public non-sealed class SportCar extends Car {
//...
}
© 2008 Haim Michael 20150805
Hidden Classes (JEP 371)
 As of Java 15, we can write code, that during its execution it
creates new hidden ones.
 The hidden classes are not discoverable. We cannot find
them using reflection.
 The hidden classes can be created using the ASP library.
More info about this library at https://asm.ow2.io/. More info
about how to create hidden classes using ASM, can be at
https://asm.ow2.io/
© 2008 Haim Michael 20150805
Patterns Matching (JEP 375)
 The patterns matching feature was introduced in Java 14.
This feature continues its preview status in Java 15 without
any enhancements.
 The current goal of is coming feature is to remove the
boilerplate code involved with the use of the instanceof
operator.
© 2008 Haim Michael 20150805
Patterns Matching (JEP 375)
Car car = new SportCar(true);
if(car instanceof SportCar sportCar) {
boolean sunRoof = sportCar.isTurbo();
//...
}
© 2008 Haim Michael 20150805
Patterns Matching (JEP 375)
 The future plan is to expand the support for patterns matching
to more features. It is strongly recommended to check out the
support for patterns matching in Scala in order to learn about
the possible features.
© 2008 Haim Michael 20150805
Foreign Memory Access (JEP 383)
 The foreign memory access was already available as an
incubating feature in Java 14. In Java 15, it continues to be in
its incubation status, while adding few more features.
 The foreign memory access feature allows us to access
memory outside of the heap managed by the JVM.
© 2008 Haim Michael 20150805
The ZGC JVM (JEP 377)
 As of Java 15, ZGC is no longer an experimental JVM. We
can start using it.
 ZGC excels in its support for large heap sizes with low
application pause times.
© 2008 Haim Michael 20150805
The Shenandoah (JEP 379)
 Shenandoah is an ultra-low pause time garbage collector. It
performs more garbage collection work concurrently with the
running program.
 As of Java 15 Shenandoah is no longer an experimental
feature.
© 2008 Haim Michael 20150805
Text Blocks (JEP 379)
 The support for text blocks is available as an experimental
feature as of Java 13. As of Java 15, the use of text blocks is
no longer experimental.
String text = """
<html>
<head>
<title>We Love Java!</title>
</head>
<body>
<h1>Java is Awesome!</h1>
</body>
</html>
""";
© 2008 Haim Michael 20150805
Text Blocks (JEP 379)
 The text we don't need to escape “ (double quotes). We can
add them without any escaping.
String text = """
we love Java "it is awesome!"
""";
© 2008 Haim Michael 20150805
Text Blocks (JEP 379)
 The String.formatter(parameter) method was added in order
to assist us with variables substitutions.
String text = """
We Love %s
%s is Awesome!
""".formatted("Java","Kotlin");
© 2009 Haim Michael All Rights Reserved 29
Questions & Answers
Thanks for Your Time!
Haim Michael
haim.michael@lifemichael.com
+972+3+3726013 ext:700
+972+54+6655837 (whatsapp)
life
michael

More Related Content

More from Haim Michael

OOP Best Practices in JavaScript
OOP Best Practices in JavaScriptOOP Best Practices in JavaScript
OOP Best Practices in JavaScriptHaim Michael
 
JavaScript Jump Start 20220214
JavaScript Jump Start 20220214JavaScript Jump Start 20220214
JavaScript Jump Start 20220214Haim Michael
 
Bootstrap Jump Start
Bootstrap Jump StartBootstrap Jump Start
Bootstrap Jump StartHaim Michael
 
What is new in PHP
What is new in PHPWhat is new in PHP
What is new in PHPHaim Michael
 
What is new in Python 3.9
What is new in Python 3.9What is new in Python 3.9
What is new in Python 3.9Haim Michael
 
Programming in Python on Steroid
Programming in Python on SteroidProgramming in Python on Steroid
Programming in Python on SteroidHaim Michael
 
The matplotlib Library
The matplotlib LibraryThe matplotlib Library
The matplotlib LibraryHaim Michael
 
Pandas meetup 20200908
Pandas meetup 20200908Pandas meetup 20200908
Pandas meetup 20200908Haim Michael
 
The num py_library_20200818
The num py_library_20200818The num py_library_20200818
The num py_library_20200818Haim Michael
 
Jupyter notebook 20200728
Jupyter notebook 20200728Jupyter notebook 20200728
Jupyter notebook 20200728Haim Michael
 
Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start) Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start) Haim Michael
 
The Power of Decorators in Python [Meetup]
The Power of Decorators in Python [Meetup]The Power of Decorators in Python [Meetup]
The Power of Decorators in Python [Meetup]Haim Michael
 
Asynchronous JavaScript Programming
Asynchronous JavaScript ProgrammingAsynchronous JavaScript Programming
Asynchronous JavaScript ProgrammingHaim Michael
 
WordPress Jump Start
WordPress Jump StartWordPress Jump Start
WordPress Jump StartHaim Michael
 
Java11 New Features
Java11 New FeaturesJava11 New Features
Java11 New FeaturesHaim Michael
 
Functional programming in Java
Functional programming in Java  Functional programming in Java
Functional programming in Java Haim Michael
 
Scala Crash Course
Scala Crash Course Scala Crash Course
Scala Crash Course Haim Michael
 

More from Haim Michael (20)

OOP Best Practices in JavaScript
OOP Best Practices in JavaScriptOOP Best Practices in JavaScript
OOP Best Practices in JavaScript
 
Java Jump Start
Java Jump StartJava Jump Start
Java Jump Start
 
JavaScript Jump Start 20220214
JavaScript Jump Start 20220214JavaScript Jump Start 20220214
JavaScript Jump Start 20220214
 
Bootstrap Jump Start
Bootstrap Jump StartBootstrap Jump Start
Bootstrap Jump Start
 
What is new in PHP
What is new in PHPWhat is new in PHP
What is new in PHP
 
What is new in Python 3.9
What is new in Python 3.9What is new in Python 3.9
What is new in Python 3.9
 
Programming in Python on Steroid
Programming in Python on SteroidProgramming in Python on Steroid
Programming in Python on Steroid
 
The matplotlib Library
The matplotlib LibraryThe matplotlib Library
The matplotlib Library
 
Pandas meetup 20200908
Pandas meetup 20200908Pandas meetup 20200908
Pandas meetup 20200908
 
The num py_library_20200818
The num py_library_20200818The num py_library_20200818
The num py_library_20200818
 
Jupyter notebook 20200728
Jupyter notebook 20200728Jupyter notebook 20200728
Jupyter notebook 20200728
 
Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start) Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start)
 
The Power of Decorators in Python [Meetup]
The Power of Decorators in Python [Meetup]The Power of Decorators in Python [Meetup]
The Power of Decorators in Python [Meetup]
 
Asynchronous JavaScript Programming
Asynchronous JavaScript ProgrammingAsynchronous JavaScript Programming
Asynchronous JavaScript Programming
 
Python Jump Start
Python Jump StartPython Jump Start
Python Jump Start
 
WordPress Jump Start
WordPress Jump StartWordPress Jump Start
WordPress Jump Start
 
Python Jump Start
Python Jump StartPython Jump Start
Python Jump Start
 
Java11 New Features
Java11 New FeaturesJava11 New Features
Java11 New Features
 
Functional programming in Java
Functional programming in Java  Functional programming in Java
Functional programming in Java
 
Scala Crash Course
Scala Crash Course Scala Crash Course
Scala Crash Course
 

Recently uploaded

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

What is new in Java 15?

  • 1. What is new in Java 15 Haim Michael April 12th , 2021 All logos, trade marks and brand names used in this presentation belong to the respective owners. life michae l Let's be on The Edge www.lifemichael.com
  • 2. © 2008 Haim Michael 20150805 XtremePython Conference https://xtremepython.dev
  • 3. © 2008 Haim Michael 20150805 XtremeJS Conference https://xtremejs.dev
  • 4. © 2008 Haim Michael 20150805 Courses on Udemy https://www.udemy.com/user/life-michael/
  • 5. © 2008 Haim Michael 20150805 Online Courses in Hebrew Https://academy.lifemichael.com
  • 6. © 2008 Haim Michael 20150805 Online Courses for Kids http://kids.lifemichael.com
  • 7. © 2008 Haim Michael 20150805 Premium Training Services https://lifemichael.com
  • 8. © 2008 Haim Michael 20150805 Scala Fundamentals Course http://scala.course.lifemichael.com
  • 9. © 2008 Haim Michael 20150805 Kotlin Fundamentals Course http://kotlin.course.lifemichael.com
  • 10. © 2008 Haim Michael 20150805 Functional Programming in Java http://functional.java.seminar.lifemichael.com/
  • 11. © 2008 Haim Michael 20150805 Table of Contents  We are going to cover the following topics: The JEP Process Records Sealed Classes Hidden Classes Patterns Matching Foreign Memory Access The ZGC JVM The Shenandoah Text Blocks
  • 12. © 2008 Haim Michael 20150805 The JEP Process (JEP 0)  The JEP process is the process of collecting, reviewing, sorting and recording the results of proposals for the enhancement of the JDK, and for related efforts.  JEP stands for Java Enhancement Proposal. The JEP process is defined by JEP 1. https://openjdk.java.net/jeps
  • 13. © 2008 Haim Michael 20150805 Records (JEP 384)  The record is a new type of class. Using the 'record' keyword (instead of 'class') we can easily create immutable data objects. public record Product(String name, int id) { }
  • 14. © 2008 Haim Michael 20150805 Records (JEP 384)  The compiler infers which private instance variable should be declared and auto generates toString, equals and hashCode accordingly.
  • 15. © 2008 Haim Michael 20150805 Records (JEP 384)  We can add the definition for a constructor with validation tests. public record Product(String name, int id) { public Product { if(id<=0) { //... } } }
  • 16. © 2008 Haim Michael 20150805 Records (JEP 384)  The record we define is implicitly final, it cannot use native methods and it cannot be declared abstract.
  • 17. © 2008 Haim Michael 20150805 Sealed Classes (JEP 360)  When defining a class as a sealed one we gain clear control over the inheritance.  In order to define a class as a sealed one we should add the sealed keyword to the class definition. In addition, we should add the permits keyword in order to specify which classes can extend our sealed class.  The class that extends a sealed class must be declared as a sealed, non-sealed, or final.
  • 18. © 2008 Haim Michael 20150805 Sealed Classes (JEP 360) public sealed class Car permits SportCar, Bus { //... } public final class Bus extends Car { //... } public non-sealed class SportCar extends Car { //... }
  • 19. © 2008 Haim Michael 20150805 Hidden Classes (JEP 371)  As of Java 15, we can write code, that during its execution it creates new hidden ones.  The hidden classes are not discoverable. We cannot find them using reflection.  The hidden classes can be created using the ASP library. More info about this library at https://asm.ow2.io/. More info about how to create hidden classes using ASM, can be at https://asm.ow2.io/
  • 20. © 2008 Haim Michael 20150805 Patterns Matching (JEP 375)  The patterns matching feature was introduced in Java 14. This feature continues its preview status in Java 15 without any enhancements.  The current goal of is coming feature is to remove the boilerplate code involved with the use of the instanceof operator.
  • 21. © 2008 Haim Michael 20150805 Patterns Matching (JEP 375) Car car = new SportCar(true); if(car instanceof SportCar sportCar) { boolean sunRoof = sportCar.isTurbo(); //... }
  • 22. © 2008 Haim Michael 20150805 Patterns Matching (JEP 375)  The future plan is to expand the support for patterns matching to more features. It is strongly recommended to check out the support for patterns matching in Scala in order to learn about the possible features.
  • 23. © 2008 Haim Michael 20150805 Foreign Memory Access (JEP 383)  The foreign memory access was already available as an incubating feature in Java 14. In Java 15, it continues to be in its incubation status, while adding few more features.  The foreign memory access feature allows us to access memory outside of the heap managed by the JVM.
  • 24. © 2008 Haim Michael 20150805 The ZGC JVM (JEP 377)  As of Java 15, ZGC is no longer an experimental JVM. We can start using it.  ZGC excels in its support for large heap sizes with low application pause times.
  • 25. © 2008 Haim Michael 20150805 The Shenandoah (JEP 379)  Shenandoah is an ultra-low pause time garbage collector. It performs more garbage collection work concurrently with the running program.  As of Java 15 Shenandoah is no longer an experimental feature.
  • 26. © 2008 Haim Michael 20150805 Text Blocks (JEP 379)  The support for text blocks is available as an experimental feature as of Java 13. As of Java 15, the use of text blocks is no longer experimental. String text = """ <html> <head> <title>We Love Java!</title> </head> <body> <h1>Java is Awesome!</h1> </body> </html> """;
  • 27. © 2008 Haim Michael 20150805 Text Blocks (JEP 379)  The text we don't need to escape “ (double quotes). We can add them without any escaping. String text = """ we love Java "it is awesome!" """;
  • 28. © 2008 Haim Michael 20150805 Text Blocks (JEP 379)  The String.formatter(parameter) method was added in order to assist us with variables substitutions. String text = """ We Love %s %s is Awesome! """.formatted("Java","Kotlin");
  • 29. © 2009 Haim Michael All Rights Reserved 29 Questions & Answers Thanks for Your Time! Haim Michael haim.michael@lifemichael.com +972+3+3726013 ext:700 +972+54+6655837 (whatsapp) life michael