My Java Quiz

The ultimate place to learn Java!

Question #31: Is the following a valid lambda expression in Java 1.8?

import java.util.function.Consumer;

public class X {
  static void process(String str, Consumer<String> consumer) {
    consumer.accept(str);
  }

  public static void main(String[] args) {
    process("a", (final s) -> System.out.println(s));
  }
}