Incorrect output
Hi...basically this program gets a character from user and checks how many times the char occoured in a file...I dont get any errors but the final count is coming out to be 0, which is incorrect
==============================================================
package examples;
import java.io.*;
//THis file counts the number of times a certain letter appears if a file
public class CountFolder {
public static void main(String[] args)throws IOException {
char c;
int count=0;
try{
System.out.println("Enter the character to be counted");
BufferedReader ch=new BufferedReader(new InputStreamReader(System.in));
c=(char) ch.read();
//System.out.println(c);
BufferedReader br=new BufferedReader(new FileReader("c:/xanadu.txt"));
do{
if((br.read())==c){
count=count+1;
}} while(br.readLine() != null);
System.out.println("The character " + c + " appeared " + count + " times in the file!");
}
finally{
}}}

