Nieuws

In this case, String::toUpperCase is an instance method reference. The instance method reference refers to the toUpperCase() method that is called on instances of String.
In Java, we don’t need to write ā€œTHEN.ā€ Instead, we use an open curly bracket to say that everything that follows is part of that ā€œcode blockā€ and should run under the conditions we specify.
I’ve used assert to check the postcondition of x being sorted before sort() returns to its caller. The example in Listing 4 demonstrates an important characteristic of assertions, which is that ...