couldnt find the bug ...
package com.codegym.task.task07.task0701;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
/*
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 {
int [] array1 = new int [20];
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for (int i = 0; i < 20; i++){
array1[i] = Integer.parseInt(reader.readLine());
}
// Create and populate the array
return null;
}
public static int max(int[] array1) {
int max1 = array1[0];
for (int i = 0; i < 20; i++){
if (array1[i]> max1){
array1[i]=max1;
}
}
// Find the maximum
return 0;
}
}