title: Recursion algorithm for the sum of all elements in a list in java
body: <p>Attempting to do a recursion exercise but I'm getting lost on how to create a method to get the sum of all elements in a list.</p>
  <p>Here's what I have so far:</p>
  <pre><code>    public int countNumberOfElements(int [] elements){
  int count = elements.length;
      if (elements.length == 0) {
          return 0;
      }
      else {
          return (countNumberOfElements(elements) + elements[count-1]);
      }
  }
  </code></pre>