1public int getIndexOfLargest( int[] array )
2{
3 if ( array == null || array.length == 0 ) return -1; // null or empty
4
5 int largest = 0;
6 for ( int i = 1; i < array.length; i++ )
7 {
8 if ( array[i] > array[largest] ) largest = i;
9 }
10 return largest; // position of the first largest found
11}
1for (int counter = 1; counter < decMax.length; counter++)
2{
3 if (decMax[counter] > max)
4 {
5 max = decMax[counter];
6 }
7}
8
9System.out.println("The highest maximum for the December is: " + max);