title: Try to get the sum of even numbers in an array using recursion
body: <p>I want to get the sum of even numbers in an array:</p>
  
  <pre><code> public static void main(String[] args) {
      int[] array = new int[4];
      array[0] = 1;
      array[1] = 2;
      array[2] = 2;
      array[3] = 4;
  
      System.out.println("Count even: " + countE(array, 0));      
   }   
  
  public static int countE(int[] arr, int head) {
          if (arr.length == head) {
          return -1;
          } else if (arr[head] % 2 == 0) {              
  
              return 1 + countE(arr, head + 1);
      } else {
  
          return 0 + countE(arr, head + 1);
      }
  }
  </code></pre>