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
Get step-by-step solutions from verified subject matter experts
