Please can someone help.
Thank you
package com.codegym.task.task07.task0701;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
/*
Maximum in an array
*/
public class Solution {
public static void main(String[] args) throws Exception {
int[] array = initializeArray();
int max = max(array);
System.out.println(max);
}
public static int[] initializeArray() throws IOException {
// Create and populate the array
int[] x= new int[20];
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for(int a = 0; a <= x.length; a++)
x[a] = Integer.parseInt(reader.readLine());
return x;
}
public static int max(int[] array) {
// Find the maximum
int b = array[0];
for(int y = 0; y <= 19; y++)
if (array[y] > b)
b = y;
return b;
}
}