LogiQuest
Back to Java 8 Features
14

What is the output of the following program?

import java.util.*;
public class Main {
    public static void main(String[] args) {
        List<String> w = List.of("apple", "avocado", "banana");
        System.out.println(w.stream().anyMatch(s -> s.startsWith("b")) + " " + w.stream().allMatch(s -> s.startsWith("a")));
    }
}
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.