The code to print the count of empty strings in Java 8 is:-

List strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");
//get a count of empty string
long count = strings.p
arallelStream().filter(string -> string.isEmpty()).count();

Point to be noted: Go through this Q&A very thoroughly as this is one of the most asked java 8 interview questions.

BY Best Interview Question ON 18 Jan 2020


List<String>strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");
int count = −> string.isEmpty()).count();