Question: 2. Write the method countEvens(int [] nums). This method should count and return a count of the number of evens that exist in the array

2. Write the method countEvens(int [] nums). This method should count and return a count of the number of evens that exist in the array nums. You may assume that nums is not null (that it has at least one value in it). Ex) int [] x = {3, 5, 4, 2, 1, 6, -3, -4} System.out.println(countEvens(x));//prints 4 since x has 4 even numbers public static int countEvens(int [] nums) { }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!