Question: In Java Write a recursive method that calculates the sum of integers in an array. The signature should be: Public static int sumArray(int[] iArray) For
In Java Write a recursive method that calculates the sum of integers in an array. The signature should be:
Public static int sumArray(int[] iArray)
For example, sumArray({1,2,3,4}) returns 10. Make up a small array and then pass it into the method from main() to test it.
Hint: You could use System.arraycopy() to copy the array to a new smaller array each time.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
