Can someone help figure out what's wrong?

package com.codegym.task.task05.task0532;
import java.io.*;
/*
Task about algorithms
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(reader.readLine());
int max = Integer.parseInt(reader.readLine());
while(reader.readLine() != null){
if(n>=max)
max = n;
n = Integer.parseInt(reader.readLine());
}
if(max>0)
System.out.println(max);
}
}

i.e you need to first initialize a bufferedreader for that.2. The program must display a number on the screeni.e your final maximum value should be displayed on console output screen.3. no need to explain ;) 4. no need to create any other method. 5. it means you have to read "n" numbers from keyboard and display the maximum of those numberthe number that you have to read from the reader should be equal to the value of n(or simply you have to read/input "n" numbers).adding the number to list will make it easy to find the maximum number. 6. it says if we enter the number n and if it is less than 0 or equals to 0. Simply print nothingi.e System.out.println();