title: Finding the largest element in an array using recursion in Java
body: <p>This is what I have so far, but I'm confused on how to keep track of the index. I would change the parameters of the method, but I'm not allowed.
  I can only use a loop to make another array. Those are the restrictions. </p>
  
  <pre><code>public class RecursiveFinder {
  
      static int checkedIndex = 0;
      static int largest = 0;
  
  
      public static int largestElement(int[] start){
          int length = start.length;
  
          if(start[length-1] &gt; largest){
              largest = start[length-1];
              int[] newArray = Arrays.copyOf(start, length-1);
              largestElement(newArray);
          }
          else{
              return largest;
          }
      }
  
  
      /**
       * @param args
       */
      public static void main(String[] args) {
          int[] array1 = {0,3,3643,25,252,25232,3534,25,25235,2523,2426548,765836,7475,35,547,636,367,364,355,2,5,5,5,535};
          System.out.println(largestElement(array1));
          int[] array2 = {1,2,3,4,5,6,7,8,9};
          System.out.println(largestElement(array2));
      }
  
  }
  </code></pre>