recursively sum the integers in an array
问题 I have a program that I'm trying to make for class that returns the sum of all the integers in an array using recursion. Here is my program thus far: public class SumOfArray { private int[] a; private int n; private int result; public int sumOfArray(int[] a) { this.a = a; n = a.length; if (n == 0) // base case result = 0; else result = a[n] + sumOfArray(a[n-1]); return result; } // End SumOfArray method } // End SumOfArray Class But I'm getting three error which are all related, I believe,