By far the most important innovation among the Java versions was Java 8 with the introduction of Lambda Expressions, Functional Interfaces and Streams. For many software developers it is still syntax and topics that need getting used to.
Nevertheless, once you understand these concepts deeply and well, you don't want to miss them! This is because these new features massively simplify many routine tasks and allow for a less error-prone and more efficient declarative style, rather than the traditionally used imperative style. Declarative style focuses on the "what-question" instead of the "how-question". The what-question expresses what a method should do, such as filtering data. The "how-question" explains the steps that are necessary to complete the task, e.g. going through all the data, filtering according to certain criteria, etc. In imperative style, the software developer has to take care of the two questions (what and how) and therefore write a lot of code. In declarative style, the software developer only cares about the "what should the method do" question and lets the Java API take care of the "how question". This proves to be very powerful when processing data with Lambda Expression and Streams and saves a lot of time.
The module system as of Java 9 allows large projects to be organized into multiple modules that are cleanly separated from each other. No project may have more cycles in its software architecture. A cycle results, for example, when a module A refers to B, module B refers to C, and then module C refers to A again. Such cycles arise quickly: when new requirements come in, deadlines and delivery dates are very short, then even experienced software developers help themselves out of time pressure and convenience with cross references between different modules in order to be able to access methods or data more quickly. As soon as everything works correctly, this is not very tragic. But as soon as an error (bug) occurs, it is incredibly difficult to locate the source, if A depends on B, B on C and C again on A. It can take days and weeks to correctly identify the source of such errors and to correct the bug. Java 9 tries to protect us from exactly this by having the module system prohibit such cycles from the start! These are just a few examples of the advantages of Java 8 and 9. In our opinion, anyone who wants to program seriously and effectively with Java should master the new features of Java 8 and 9.
The Functional Programming with Java 8-11 module includes the following focus areas:
- Imperativer vs. deklarativer Stil
- Behavior Parameterisation
- Lambda Expression
- Functional Interface
- Optional Class
- Methods and Constructor Reference
- Collections and Stream API
- Module System as of Java 9
- The new Date API
- Immutable Collections: list.of( ), set.of( ), map.of( )
- JSHELL