0 votes
16 views

What is Parallel Processing in Java 8?

in Education by (49.4k points)

1 Answer

0 votes

What is Parallel Processing in Java 8?

parallelStream is the alternative of stream for parallel processing. Take a look at the following code segment that prints a count of empty strings using parallelStream.

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.

by (49.4k points)

Related questions

0 votes
1 answer 13 views
0 votes
1 answer 47 views
0 votes
1 answer 13 views
0 votes
1 answer 34 views
0 votes
1 answer 14 views
0 votes
1 answer 19 views
0 votes
1 answer 16 views
0 votes
1 answer 13 views
13 views asked Nov 8, 2020 in Education by Editorial Staff (49.4k points)
0 votes
1 answer 13 views
0 votes
1 answer 14 views
14 views asked Nov 8, 2020 in Education by Editorial Staff (49.4k points)
0 votes
1 answer 13 views
0 votes
1 answer 11 views
0 votes
1 answer 16 views
0 votes
1 answer 11 views
0 votes
1 answer 8 views
0 votes
1 answer 15 views
0 votes
1 answer 21 views
0 votes
1 answer 24 views
0 votes
1 answer 7 views
0 votes
1 answer 13 views
...