Hi,
This time I have a very lame problem, which was working perfectly but now its not:
BufferedReader br = new BufferedReader(new InputStreamReader(
System.in));
while (br.readLine() != null) {
System.out.println(br.readLine());
}
Input file:
1
2
3
4
5
6
7
8
9
In command line: $java myprogram < inputfile
The result of the above written code is:
2
4
6
8
null
But the expected output should be same as input file! :(
Where am I going wrong?!