Question: Write a method countNegatives that uses stream operations to count how many numbers in a given array of integers are negative. For example, if the
Write a method countNegatives that uses stream operations to count how many numbers in a given array of integers are negative. For example, if the array is {5, -1, -3, 20, 47, -10, -8, -4, 0, -6, -6}, return 7.
Step by Step Solution
3.23 Rating (158 Votes )
There are 3 Steps involved in it
returns count of negative numbr... View full answer
Get step-by-step solutions from verified subject matter experts
