title: Error: ; expected (Compile error in Java)
body: <p>When <code>isLetter()</code> method is deleted everything is working fine but when I add it it gives an error. I removed private as it is in the main method. Please help. Thanks in advance.</p>
  
  <pre><code>import java.io.*;
  class WordCounter{
  
  public static void main(String args[]){
      File file_in_obj = new File("E:/Problems","notes.txt");
      File file_out_obj = new File("E:/Problems","notes_sorted.txt");
  
      boolean isLetter(char let){
          return ( let&gt;= 'a'&amp;&amp; let &lt;= 'z') || ( let &gt;= 'A' &amp;&amp; let &lt;='Z');
      }
  
      try(BufferedReader fin = new BufferedReader(new FileReader(file_in_obj));
      BufferedWriter fout = new BufferedWriter(new FileWriter(file_out_obj));){
  
      String array[]=new String[500];
      char ch[]=new char[25];
      int rd,k=0;
      String line=null;
  
          /*do{
              rd=fin.read();
              if(Character.isWhitespace((char)rd))
                  fout.write(" ");
              else if(Character.isLetter((char)rd)){
  
                      fout.write((char)rd);
                  }
          }while(rd!=-1); */
  
          while((line=fin.readLine())!=null){
              //  System.out.println(j++);
              String[] tokens = line.split ("\\s+"); 
              for(int i = 0; i &lt; tokens.length; i++){
                      array[k]=tokens[i];
                      fout.write(array[k]+" ");
                      k++;
                      //System.out.println(tokens.length);
              }
  
          }
          for(int p=0;p&lt;k;p++){
              for(int i=0;i&lt;array[p].length();i++){
                  if(Character.isLetter(array[p].charAt(i)))
                      System.out.print(array[p].charAt(i));
              }
              System.out.println(p);
          }
  
      /*for(int j=tokens.length;j&gt;1;j--)
      for(int i=0;i&lt;j-1;i++){
          if(tokens[i].compareTo(tokens[i+1])&gt;0){
                  String temp=tokens[i+1];
                  tokens[i+1]=tokens[i];
                  tokens[i]=temp;
          }
      }*/
  
      } catch(IOException e){
          System.out.println("I/O Exception occured");
      }
  
  }
  }
  </code></pre>