Here is my code I am using this code to input number of test cases of a problem in codechef but this error occurs whereas in my local machine ubuntu 20.04LTS it successfully compiles.
import java.io.*;
import java.math.BigDecimal;
import java.util.*;
class WorldRecord {
public static void main(String args[])throws IOException
{
//Scanner b=new Scanner(System.in);
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int t;
try{
t = Integer.valueOf(br.readLine().trim());
}
catch(NumberFormatException e){
System.err.println(e);
}
catch(IOException e){
System.err.println(e);
}
catch(NullPointerException e){
System.err.println(e);
}
finally{
t = Integer.parseInt(br.readLine().trim());
}
}
}
Here is my error
java.lang.NullPointerException
Exception in thread "main" java.lang.NullPointerException
at WorldRecord.main(Main.java:26)