Mastering Java 11 LIVE 9-13 January 2023

"Java After 8" Series

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.

We will make recordings of the sessions in case anyone misses anything or would like to revise the material at a later date. These should become available within 24 hours of each session.

Detailed Outline

Part 1: Encapsulation Improvements
  • JEP 261: Module System
    • Impedence Mismatch between the JVM and us
    • Project Jigsaw history and goals
    • Java Module System Basics
      • Readability, Accessibility, Strong Encapsulation, Use Cases
      • Using no module, single module, multiple modules
    • Beyond the Basics
      • Transitive Dependencies
      • Optional Dependencies
      • Services
      • Qualified Exports
      • Deep Reflective Access
    • Migration Challenges
      • Internal APIs
      • JEE Modules
      • Split Packages
      • Runtime Images
    • Incremental Modularization
      • The Unnamed Module
      • Automatic Modules
      • Modularization Strategies
    • Conclusion
  • JEP 260: Encapsulate Most Internal APIs
    • Included in JEP 261 section
  • JEP 277: Enhanced Deprecation
    • @since, @forRemoval
    • How to consider deprecation in future
  • JEP 238: Multi-Release JAR Files
    • Supporting several Java versions
Part 2: Performance Improvements
  • JEP 254: Compact Strings
    • byte[] replacing char[]
    • Effect on non-LATIN1 Strings
    • Deduplication
    • intern()
  • JEP 280: Indify String Concatenation
    • Fast addition of mixed types in various Java versions
    • invokedynamic and String +
  • JEP 328: Flight Recorder
    • Starting and controlling Java Flight Recorder
    • Creating own events
    • Viewing and analyzing results in JDK Mission Control
  • JEP 248: Make G1 the Default Garbage Collector
    • Overview of garbage collectors: Serial, Throughput, CMS (deprecated), G1, ZGC, Shenandoah
    • Types of issues that we see with GC affecting throughput and latency
    • Logging the garbage collection activity
  • JEP 318: Epsilon: A No-Op Garbage Collector (Experimental)
    • Description of no-op GC
    • Use cases for never collecting
Part 3: Language Improvements
  • JEP 286: Local-Variable Type Inference
    • Type duplication, locality
    • Rules of "var"
    • Style guidelines
      • Choose variable names that provide useful info
      • Minimize the scope of local variables
      • Consider var when the initializer provides sufficient information to the reader
      • Use var to break up chained or nested expressions
      • Don’t worry too much about "programming to the interface"
      • Take care when using var with diamonds or generics
      • Take care when using var with literals
  • JEP 323: Local-Variable Syntax for Lambda Parameters
    • Consistency and annotations
  • JEP 213: Milling Project Coin
    • Private interface methods
    • Effectively final variables to be used with try-with-resource
    • Diamond operator with anonymous types
    • @SafeVarargs
    • Removal of underscore _ as identifier
Part 4: Concurrency Improvements
  • JEP 193: Variable Handles
    • MethodHandles.Lookup
    • MethodHandles.privateLookupIn()
    • Compare-and-swap (CAS) and non-blocking algorithms
    • Best practices
  • JEP 266: More Concurrency Updates
    • Reactive Streams (very) Quick Intro
    • CompletableFuture Enhancements
Part 5: Tools and API Improvements
  • JEP 269: Convenience Factory Methods for Collections
    • List.of(), Set.of(), Map.of()
    • True immutability
    • What about Arrays.asList()?
  • JEP 321: HTTP Client
    • HttpClient, HttpRequest, HttpResponse
    • Creating HttpClient and HttpRequest using builders
    • Asynchronous request returning CompletableFuture
    • Reactive request and response bodies
  • JEP 330: Launch Single-File Source-Code Programs
    • ClassLoader gotchas
  • JEP 158: Unified JVM Logging
    • Tags, levels, output, decorators
    • Configuring logging from jcmd
  • JEP 222: jshell: The Java Shell (Read-Eval-Print Loop)
    • Java REPL
    • Default imports
    • Semicolons
    • Autocompletion
    • Practical uses
  • JEP 259: Stack-Walking API
    • Efficient standard way to walk the call stack
    • Additional information about classes and methods
  • JEP 290: Filter Incoming Serialization Data
    • ALLOWED, REJECTED, UNDECIDED
    • Global filter
    • Filter with String pattern
Conclusion
  • Where to next
  • Java 17 and beyone
  • The Java Specialists' Newsletter

Satisfaction Guarantee

Should you not be satisfied with the quality of the training or the delivery, we will gladly refund you 100% of the course fees. This needs to be brought to our attention within the first 2 hours of the course and a chance should be given to correct whatever you are not satisfied with. If you are still not satisfied, we will refund you 100% of the course fees and will unenroll you from the course.

Java 17?

We are also running our Mastering Java 17 Course in February 2023 for those who are already using Java 11 and would like to learn the latest features of Java 17. If you would like both, please consider getting our Mastering Java 11 and 17 Course Bundle.

Your Instructor


Dr Heinz M. Kabutz
Dr Heinz M. Kabutz

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.


Frequently Asked Questions


How long do I have access to a fully paid course?
How does lifetime access sound? After enrolling, you have unlimited access to this course for as long as you like - across any and all devices you own. Furthermore, if we move to another platform, we will offer you a free transfer of your account for all the courses that you have purchased.
How many times can I cancel and rejoin a subscription course?
To prevent abuse, we limit the number of times that you can cancel and rejoin our subscription based courses to three times.
What is the difference between a subscription, paying in installments and an outright purchase?
With a subscription, you never own the rights to the material. If your card is declined or you cancel your subscription, you lose access to the course. The money you have paid so far is lost. Paying in installments is a bit better. You pay for 5 or 10 months and then once you have completed your installments you have lifetime access to the course. The safest is an outright purchase, where you pay the entire course in one amount. There is no risk of losing access.
Can I pay via PayPal?
Yes, you can for outright purchases, but not for recurring payments such as paying by installments or subscriptions.
Can I get an EU VAT Invoice?
Absolutely. First off, be sure to enter the VAT number in the appropriate field during the payment process. Then contact us for an EU VAT Invoice. Please tell us the receipt number for which you need the invoice.
May I share my login details with my colleagues?
Unfortunately not. The terms of usage are for a single license. Teachable tracks your progress through the curriculum, so you won't know how much you have watched. We offer a 30% discount on 50 licenses or more by one company. Please contact us for bulk licensing.
May we use the course for running in-house courses?
You may, as long as each of the students in the class has a valid license for that course. For example, some companies run lunch time Design Patterns study groups using our material. This is an effective way to learn. Please contact us for bulk licensing.
What if I am unhappy with the course?
We would never want you to be unhappy! If you are unsatisfied with your purchase, contact us in the first 30 days and we will give you a full refund and deregister you from the course.
When does the course start and finish?
The course starts now and never ends! It is a completely self-paced online course - you decide when you start and when you finish. We do recommend putting time aside and setting goals to complete the course.
Can I watch the course offline during my commute?
Teachable have an iOS app that lets you watch offline. Android is not supported unfortunately.

Get started now!