Question: java programming Write a method called sumEven that take a two-dimension array of integers as a parameter and returns the sum of the even numbers.
java programming

Write a method called sumEven that take a two-dimension array of integers as a parameter and returns the sum of the even numbers. For example, if the array (as created by the program below) is 8 10 45 3 2 42 3 21 44 The value returned would be 106 (10+8+2+42+44). public class Question2 { public static void main(String args[]) { int arr[][] {{10, 45, 3, 8}, {2, 42}, {3, 21, 44}}; System.out.println("The sum of the even numbers is "+ sumEven (arr)); } //main public static int sumEven (int[][] myArray) {
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
