My code is as follows:
import java.util.*;
import java.io.*;
public class Buffer
{
public static void main(String args[]) throws Exception
{
int T;
Scanner sc = new Scanner(System.in);
T = sc.nextInt();
while(T > 0)
{
InputStreamReader r = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(r);
String no = "";
no = br.readLine();
char ch = no.charAt(0);
if (ch == '0')
{
System.out.println("YES");
}
else
{
System.out.println("NO");
}
T--;
}
}
}
Please help me with my code, what is wrong exactly?
I am getting the output:
Run Time Error Exception in thread "main"<br>
java.lang.NullPointerException at Buffer.main