public class recursive { public recursive(){} public int factorial(int val){ if(val == 0) return 1; else return (val * factorial(val - 1)); }//end of method. public int largest(int[] array, int lower, int upper){ int max; if(lower == upper) return array[lower]; else max = largest(array, lower + 1, upper); //recursion starts here until it exhausted all //elements in the array then it'll execute the IF-statement below. if(array[lower] >= max) return array[lower]; else return max; }//end of method. }