0 votes
in Education by (55.5k points)

List<String> strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");

1 Answer

0 votes
by (55.5k points)

List<String> strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");

//get count of empty string

int count = strings.parallelStream().filter(string -> string.isEmpty()).count();

//It is very easy to switch between sequential and parallel streams.

...