public static int findMax(Integer [] a){ int max = a[0]; for (int i=0; i<=a.length-1;i++){ if(a[i]>max){ max = a[i]; } } return max; }