Which of the following lambda expressions is invalid?
What is the type of the following lambda expression: x -> x.length()?
Which functional interface should be used for a lambda that filters elements?
What will this code print?
List<Integer> list = Arrays.asList(1, 2, 3, 4, 5);
list.forEach(x -> System.out.print(x + " "));
Can lambda expressions access local variables from their enclosing scope?
Advertisement
Which of the following correctly represents a BiFunction?
What is the difference between a lambda expression and an anonymous inner class?
Which of the following statements about @FunctionalInterface is true?
Can a lambda expression have multiple statements in its body?
Which functional interface is best suited for this scenario: method that takes no parameters and returns a random number?
In Java streams, what does the filter() method use?
What will be the result of executing: List<Integer> nums = Arrays.asList(1, 2, 3, 4); nums.stream().map(x -> x * 2).collect(Collectors.toList());
Consider: Function<Integer, Integer> f = x -> x * x; What will f.apply(5) return?
What is the purpose of the Optional class when used with lambda expressions in Stream operations?
Which of the following lambda expressions is INCORRECT?
Consider: Stream.of(1, 2, 3, 4, 5).filter(x -> x > 2).map(x -> x * x). What will the terminal operation need to be?
What is method reference (::) in Java and how does it relate to lambda expressions?
What is the difference between peek() and forEach() when used with lambda expressions in Streams?
In the lambda expression (a, b) -> a.compareTo(b), what is the implicit functional interface?
What will be the output of: IntStream.range(1, 4).map(x -> x * 2).sum();