Consider: Stream.of(1, 2, 3, 4, 5).filter(x -> x > 2).map(x -> x * 2).forEach(System.out::println); What will be the output?
What is the difference between peek() and forEach() in streams?
What issue can arise when using lambda expressions with checked exceptions?
What will be the output of: IntStream.range(1, 4).map(x -> x * x).forEach(System.out::print);
In the lambda expression (a, b) -> a.compareTo(b), what can we infer about the parameters?
Advertisement
Which of the following correctly uses method reference with constructor?
What happens when a lambda expression references a local variable from its enclosing scope?
What will be the output of: List<Integer> list = Arrays.asList(1, 2, 3); list.replaceAll(x -> x * 2); System.out.println(list);
Which of the following lambda expressions has incorrect syntax?
What will be the type of the lambda expression (x) -> x.toString()?
Which functional interface should be used for a lambda with no parameters and no return value?
What is the difference between Consumer and Function functional interfaces?
Which of the following uses method reference correctly?
Which of the following lambda expressions will compile successfully?
In the lambda expression (x) -> x < 10 && x > 0, what is the parameter type?
Which of the following statements about variable scope in lambda expressions is TRUE?
Consider: Comparator<String> comp = (s1, s2) -> s2.compareTo(s1);
What does this lambda expression do?
Which lambda expression is equivalent to the method reference Integer::parseInt?
Analyze: What is the output?
BiConsumer<String, String> printer = (a, b) -> System.out.println(a + b);
printer.accept("Java", "8");
What is the return type of a lambda expression (x, y) -> x + y where x and y are integers?