title: Recursively keeping count in Java - Simple
body: <p>I know that I'm overlooking something incredibly fundamental and elementary, but I need help with creating a mean function that, using only one parameter (the list containing the integers- in this case), calculates the mean of the given integers.</p>
  
  <pre><code>public static double mean (Cons lst) {
      int total = (Integer) lst.data;
      int count = //something to keep count through the recursion
  
      if(lst.next == null) {
          return total / count;
      }
  
      else return mean(lst.next); // return statement isn't correct, need help here as well
  }
  </code></pre>
  
  <p>Any help would be great. If the easiest way to explain is by writing the method itself, then that'd be wonderful, but I'm just trying to figure out how to recursively keep a running count <em>without adding params</em>.</p>
  
  <p>Thanks a lot.</p>