My Java Quiz

The ultimate place to learn Java!

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

import java.util.function.BiConsumer;

public class X {
  static void process(String str1, String str2, BiConsumer consumer) {
    consumer.accept(str1, str2);
  }

  public static void main(String[] args) {
    process("a", "b", (String s1, s2) -> System.out.println(s1 + s2));
  }
}