Upgrade to Modern Java

Over the past few years, the basic idioms and recommended programming styles for Java development have changed. Functional features are now favored, using streams, lambda expressions, and method references. The new six-month release schedule provides the language with new features, like modules and local variable type inference, much more frequently. Even the new license changes in the language seem to complicate installation, usage, and especially deployment.

The purpose of this one-day workshop is to help you adapt to the new ways of coding in Java. The latest functional approaches are included, including using parallel streams for concurrency, and when to expect them to be useful. All the new significant features added to the language will be reviewed and evaluated, with the goal understanding what problems they were designed to handle and when they can be used effectively in your code.

UMJ Workshop Outline

Java Licensing and Release Schedule

  • Is Java still free?
  • Implementations and downloads
  • Vendors, cloud and otherwise

Lambda Expressions and Method References

  • Functional programming concepts
  • Expression lambdas and block lambdas
  • Method references for both instance methods and static methods

Functional Interfaces

  • The java.util.function Package and its uses
  • Consumers
  • Suppliers
  • Predicates
  • Functions
  • Primitive type and multiple argument variations

Static and Default Methods in Interfaces

  • Implementing default methods
  • Handling conflicts between default methods
  • Static interface methods in the standard library
  • Private methods in interfaces

Java Streams

  • The Stream interface
  • Map, filter, and reduce methods
  • Using collectors
  • Extra methods with primitive streams
  • Differences between map and flatMap

The Optional Data Type

  • Wrapping values in Optional
  • Processing with map, filter, and other methods
  • Providing defaults and throwing exceptions

Special Topics

  • Lazy instantiation using Suppliers
  • Debugging with peek
  • Deferred execution
  • Parallel streams

More recent additions to the language

  • LVTI
  • Text blocks
  • Records
  • Enhanced switch
  • Pattern matching
  • The future

About Kenneth Kousen

Ken Kousen is a Java Champion, several time JavaOne Rock Star, and a Grails Rock Star. He is the author of the Pragmatic Library books “Mockito Made Clear” and “Help Your Boss Help You,” the O'Reilly books “Kotlin Cookbook”, “Modern Java Recipes”, and “Gradle Recipes for Android”, and the Manning book “Making Java Groovy”. He also has recorded over a dozen video courses for the O'Reilly Learning Platform, covering topics related to Android, Spring, Java, Groovy, Grails, and Gradle.

His academic background include BS degrees in Mechanical Engineering and Mathematics from M.I.T., an MA and Ph.D. in Aerospace Engineering from Princeton, and an MS in Computer Science from R.P.I. He is currently President of Kousen IT, Inc., based in Connecticut.

More About Kenneth »