package com.codegym.task.task07.task0721; import; import; import; /* Min and max in arrays Create an array of integers (int[]) with 20 elements. 2. Read 20 integers from the keyboard and add them to the array. 3. Find the maximum and minimum integers, and then display them separated by a space. 4. Use a for loop. */ public class Solution { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(; int[] n=new int[20]; for(int i=0;i<20;i++) { n[i]=Integer.parseInt(br.readLine()); } int maximum=0; int minimum=0; for(int i=0;i<20;i++){ if(n[i]>n[i+1]){ maximum=n[i]; } if(n[i]<n[i+1]) minimum=n[i]; } //write your code here System.out.print(maximum + " " + minimum); } } Also while I am trying to run without execution I am getting following : java.lang.NumberFormatException:, method main, line: 22 Error converting a string to a number (invalid format). java.lang.NumberFormatException: null at java.lang.Integer.parseInt( at java.lang.Integer.parseInt( at com.javarush.task.task07.task0721.Solution.main( at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at com.javarush.task.common.model.execution.ExecuteService.callMainMethod( at com.javarush.task.common.model.execution.ExecuteService.execute( at at at