What will be the output of the following code? -------------------- public static void main(String[] args) { List<String> list = Arrays.asList("apple", "banana", "cherry"); String result = list.stream().filter(s -> s.matches(".*n.*")).findFirst().orElse("none"); System.out.println(result); }
Geekific
What will be the output of the following code?
--------------------
public static void main(String[] args) {
List<String> list = Arrays.asList("apple", "banana", "cherry");
String result = list.stream().filter(s -> s.matches(".*n.*")).findFirst().orElse("none");
System.out.println(result);
}
1 month ago | [YT] | 2