I/O Operations in java

Hi,
I’m reading the sample input in java but getting null in readLine.

class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
java.io.BufferedReader r = new java.io.BufferedReader
(new java.io.InputStreamReader (System.in));
int a=Integer.parseInt(r.readLine());
System.out.println(a);
}
}