News

The former method is executed by default methods a() and b(), and the latter method is executed by static method d(). Compile Listing 21 (javac PMDemo.java) and run the application (java PMDemo).
The code instructs the program to “use the static method from this class” instead of writing a lambda. Method references vs. lambda expressions Now let’s compare two examples.