Highest Frequency of Letter(s) in each Line of File-Core Java Programming
<p>StackOverflow people, </p>

<p>Need Java Advice and Code which reads a file(File.txt) and prints to the console a list of all the letters that occurred with the highest frequency in each line of the file, followed by the frequency.</p>

<p>The list of letters should be an alphabetical list of upper case letters followed by an alphabetical list of lower case letters.</p>

<hr>

<h2>Sample Input File(File.txt)</h2>

<p>When riding your bicycle backwards down a one-way street, if the<br>
wheel falls of a canoe, how many ball bearings does it take to fill<br>
up a water buffalo?<br>
Hello Howard. </p>

<hr>

<h2>Sample Output</h2>

<p>e 6<br>
al 7<br>
a 3<br>
Hlo 2     </p>

<p>Sample Code:</p>

<pre><code>public class ReadFileFromSystem{

      public static void main(String args[]){
           BufferedReader in = new BufferedReader(new FileReader("C:/input.txt"));//the file containing lines.
       HashMap&lt;Character,Integer&gt; lettercount = new HashMap&lt;Character, Integer&gt;();
           int counter =0;


           // string buffer for file reading   
           StringBuffer str;

           // reading line by line from file    
           while ((str = in.readLine()) != null) { 
                // process each characters  
                 for (int i = 0; i &lt; str.length(); i++) {
                          char c = str.charAt(i);                 
                          if (Character.isLetter(c)){
                              if(counter&gt;1){       
                                   counter++;                           
                          }else{
                                 lettercount.put(c,1);                            
                          }                          
                }
           }
           System.out.println("The Alphabet"+c+" has a highest frequency of "+counter); 
     } 
</code></pre>
