R9.
2014-05-12 23:53:45 UTC
BufferedReader reader = new BufferedReader(file);
String text="";
String line= reader.readLine();
while(line != null){
text+=line;
text = text + "\n";
line =reader.readLine();
}
System.out.println(text);
This is a sample of my program , it reads my text file that contains numbers
23,44,12,11
12,45,44,10
11,9,8,3
2,1,44,3
how can I count each number in my file and display which number occurs most often ?
I think its going to be a loop that counts each number, but I dont know how.