Latest Features: from Java 11 to Java 21

CHAIRI Chaimae
3 min readJan 23, 2024

--

I began learning Java 17 five months ago. I started from the OOP paradigm and progressed to more advanced topics. However, staying up to date with new features in Java is as crucial as being a software engineering student. This is a quick recap of the 160th episode about Java presented by Geeks Blabla’s, the largest tech community in Morocco. The guests talked about plenty of interesting points, and I noted them as follows. Happy reading!

6-month release:

It refers to the regular release cadence adopted by Oracle for the Java Platform, Standard Edition (Java SE) starting with Java 9. This helps to become more agile and collect feedback.

Logo of java: cybrhome.com

OpenJDK projects:

These are initiatives within the OpenJDK community that focus on enhancing, extending or introducing new features and improvements to the Java programming language and its associated tools and libraries.

Porject LOOM: Reshapes Java’s concurrency paradigm through the introduction of lightweight user-mode threads, providing developers with a more accessible and scalable method for managing threads and achieving efficient concurrency.

Virtual Threads : The general availability introduced in the JDK 2021. It is useful with many concurrent requests and reduces Context Switching between threads whitch can be costly in terms of CPU, time and resources. Moreover, it represents an effective solution in cases where the code has a blocking scope. Virtual threads mainly address business-related tasks.

Project Valhalla: Focuses on enhancing Java's data representation by primitive classes and wrapper as well as data manipulation capabilities to improve performance and memory efficiency.

Project Panama: Focuses on improving the connection between Java and native code, introducing the Foreign Function and Memory API (FMA). Therfore, it makes it easier to work with native libraries and data in a more efficient and type-safe manner.

Project Leyden: The JVM's quick startup helps minimize the delay in responding to the first request when an application is running in serverless mode or lambda.

Project Amber: Focuses on improving the Java language itself, introducing features to simplify code and pattern matching to make code more concise .

To get know more about this topic, please check this vedio form Devoxx:

Record class: Serves as a data container and utilize its canonical constructor to validate and process incoming responses from requests, reduces the boilerplate code typically associated with Java classes, enforces immutability and cannot be extended. It can be mocked for testing purposes using mocking frameworks.

Pattern matching: Production ready. It simplifies and enhances conditional and type-based operations, which makes code more concise and stable.

2 misconceptions:

  1. Java has historically been criticized for its verbosity, which refers to the amount of boilerplate code required to accomplish certain tasks.

2. Java is slow : Its performance depends on various elements, which includes the way it is implemented, how efficient it is at runtime, and the features of the particular application.

However, it is still less energy-consuming in comparison to other programming languages.

Application Migration:

Situation: A Java application needs to be migrated from Java 5 to Java 17.

Directions: You can gradually upgrade the application from version 5, progressing through versions 7, 8, and finally reaching 17. You should verify the libraries compatibility . Furthermore, it is recommended to extend app monitoring and begin testing using a smaller application.

Were these new Java features supported by enhancing the compiler alone, or did they require a rewrite of the JVM?

The two parts of the question are indeed accurate; both enhancing the compiler and rewriting the JVM and memory structures have been involved in supporting the new features.

Final Recommendations:

  1. Take your time to learn Java;
  2. Be patient with learning;
  3. Visit ressources documentation, books….;
  4. JAVA it : you would better regularly practice to build the java muscles, either by solving problems on platforms such as hackerrank or by building projects;
  5. Emphasize the significance of basics;
  6. Follow JAVA Champions on Twitter and Linkedin.

Final point: You’re new to learn Java and you might ask which Java version you should start with?

Most of experts and Java Champions recommend learning the latest version as it includes both old and new features.

Find it useful? let’s hear from you and share the java journey!

--

--

CHAIRI Chaimae
CHAIRI Chaimae

Written by CHAIRI Chaimae

This space's to document my learning and track my progress. Hope it helps someone somewhere. You're welcomed!

No responses yet