Stream 一类的类应该没有readLine这类的method

解决方案 »

  1.   

    import java.io.*;
    class filestreamstest3{
    public static void main(String args[]){
     String b="";
     int j=0;
     try{
         BufferedReader in = new BufferedReader(new FileReader("output.txt"));
         while((b = in.readLine())!=null)
          {
           if (b.indexOf("am") != -1)
           {
           j = j+1;
           System.out.println(j);
           }      }
      in.close();
        }catch(FileNotFoundException e){ }  catch(IOException e){ }
       }
    }