public class MainClass public static void main String args throws IOEx

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
public class MainClass {
public static void main(String[] args) throws IOException {
int[] arr = {14,28,6,72};
int n = arr.length;
int max = findMax(arr, n-1);
System.out.println(max);
}
public static int findMax(int[] array, int n) {
int max=array[0];
if (n>0) max=findMax(array, n-1);
if (array[n]<max) return max;
else return array[n];
}
}