问题: if(e.getActionCommand()=="下一条")
       {
 if(flag)
 {
   try
   {
     stu=myBR.readLine();
     myBR.(1);
   }
   catch(IOException err)
   {
     System.err.println("文件读错误");
     System.exit(1);
   }

   try
   {
     myBR.reset();
   }
   catch(IOException err2)
   {
   }
   StringTokenizer st=new StringTokenizer(stu,":");
   ......
上面是读取文件代码的一部分,有两句不太明白,myBR.(1);和myBR.reset();(myBR是BufferedReader的一个实例)书上没写解释,哪位大哥给看看,最好写上解释,谢谢啦

解决方案 »

  1.   


    public void (int readAheadLimit)
              throws IOExceptionMark the present position in the stream. Subsequent calls to reset() will attempt to reposition the stream to this point.---------------------------------------
    reset
    public void reset()
               throws IOExceptionReset the stream to the most recent .
      

  2.   

    首先,String用equals比较(n)就是在流的当前位置做个记号,n表示这个在读n个字符内有效(超过可能就会无效)
    reset就是恢复到上次的地方(如果失效,会有异常)