Mastering Java 11
The Module System and other features of Java 11
Oracle produces a new "feature release" of Java every six month. Teams that do not move forward with this rapid pace, run the risk of having to work with outdated technology, and are often forced to code around shortcomings that have already been solved in more modern Java.
In this course, we teach the most important new features of Java 9, 10, and 11. It is ideal for programmers tho are currently programming Java 8, and who need to upgrade their systems, or even programmers that are using Java 11, but feel that they have not understood all the intricacies of the new version.
We begin with encapsulation improvements, where most of our time is spent on the Java Platform Module System (JPMS). We explore how we can use JPMS to modularize our own applications and libraries. We show how the module-info.java file can give us better encapsulation and cleaner interfaces between modules. We then look at how deprecation is stricter and how we can build jar files that support several versions of Java.
Our next focus is on performance improvements in Java 11, looking at how Strings are enhanced, garbage collection, the Java Flight Recorder, and how we can use the JDK Mission Control to analyze performance bugs.
We then look at a few language improvements, specifically the new "var" construct, and how and when to use it. We then look at several small changes in the language that make coding more convenient.
We then investigate some additions to concurrency, such as how we can use VarHandles to atomically update fields, much like atomic field references worked in the past. We also show how to get the best performance from VarHandles, to match that of sun.misc.Unsafe. Lastly, we look at a few new concurrency improvements.
We end our Java 11 excursion by learning about tools and API improvements, beginning with the collection factory methods to create immutable List, Set and Map instances. We then spend some time learning about HttpClient, and the three modes of communication: synchronous, asynchronous, and reactive. We learn how to launch single-file Java programs without the need to first compile the classes, and how JShell acts as a Java REPL. We also learn about the new unified logging that gives us insight into how the JVM runs. Our last two topics are the new StackWalker API, allowing us to get more information of which methods are in our stack, and the new ObjectInputFilter to make serialization more secure.
During the training, we will always get a chance to try out what we have learned in carefully thought out exercises. This will help us understand and quickly internalize what we have just learned.
Your Instructor
Heinz Kabutz is the author of The Java Specialists’ Newsletter, a publication enjoyed by tens of thousands of Java experts in over 150 countries. He has been a Java Champion since 2005.
Course Curriculum
-
Preview1.01. Welcome to the Mastering Java 11 Course (4:04)
-
Preview1.02. Day 1 - Encapsulation Improvements (2:29)
-
Preview1.03. JEP 261 - The Java Module System Intro (14:09)
-
Preview1.04. JEP 261 - Java Module System Basics (24:06)
-
Preview1.05. JEP 261 - Exercise 00 - Class Path (9:43)
-
Start1.06. JEP 261 - Single Module (4:00)
-
Start1.07. JEP 261 - Exercise 01 - A Single Module (7:40)
-
Start1.08. JEP 261 - Multiple Modules (5:51)
-
Start1.09. JEP 261 - Exercise 02 - Multiple Modules (7:57)
-
Start1.10. JEP 261 - Beyond the Basics (9:31)
-
Start1.11. JEP 261 - Exercise 03 - Implied Readability (7:59)
-
Start1.12. JEP 261 - Optional Dependencies (10:22)
-
Start1.13. JEP 261 - Exercise 04 - Optional Dependencies (6:48)
-
Start1.14. JEP 261 - Services (6:04)
-
Start1.15. JEP 261 - Exercise 05 - Services (29:29)
-
Start1.16. JEP 261 - Qualified Exports (3:54)
-
Start1.17. JEP 261 - Exercise 06 - Qualified Exports (1:41)
-
Start1.18. JEP 261 - Deep Reflective Access (5:02)
-
Start1.19. JEP 261 - Exercise 07 - Deep Reflective Access (5:11)
-
Start1.20. JEP 261 - Migration Challenges (4:10)
-
Start1.21. JEP 261 - Migration Challenges - Internal APIs (4:17)
-
Start1.22. JEP 261 - Migration Challenges - JEE Modules (2:03)
-
Start1.23. JEP 261 - Migration Challenges - Split Packages (4:08)
-
Start1.24. JEP 261 - Migration Challenges - Runtime Images (3:05)
-
Start1.25. JEP 261 - Incremental Modularization (1:30)
-
Start1.26. JEP 261 - Incremental Modularization - The Unnamed Module (1:58)
-
Start1.27. JEP 261 - Incremental Modularization - Automatic Modules (3:54)
-
Start1.28. JEP 261 - Incremental Modularization - Modularization Strategies (6:24)
-
Start1.29. JEP 261 - Conclusion (0:31)
-
Start1.30. JEP 277 - Enhanced Deprecation (8:08)
-
Start1.31. JEP 277 - Exercise Walkthrough (10:45)
-
Start1.32. JEP 239 - Multi-Release JAR Files (2:26)
-
Start1.33. JEP 239 - Exercise Walkthrough (15:41)