From the course: Migrating beyond Java 8

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Java 11 language and API features

Java 11 language and API features - Java Tutorial

From the course: Migrating beyond Java 8

Start my 1-month free trial

Java 11 language and API features

- [Instructor] Java 11 introduced many new features to the language, making it a pretty exciting release for Java developers. Let's take a look at some of the new methods and classes this version introduced. We'll start by exploring some new methods that were added to the string class. Here you can see in our isBlank method that we are trimming a string, and then checking to see if it's empty. This is a common validation used to check for empty strings and for strings that are entirely white space. It got much easier to perform this check in Java 11, because the isBlank method was added to the string interface. Moving on to the strip method. You'll notice that its implementation calls the trim method and it may make you wonder, "What's wrong with trim?" Well, we can find that answer in one of our unit tests. Here, you'll notice that I add Unicode white space to the beginning and end of this string. Now, if we were to…

Contents