import java.io.*;
public class FileReader { public static void main(String[] args) {
      FileReader fr=null;
   int t=0;
try{
fr=new FileReader("e:\\HelloJava.java");     //构造函数 FileReader(String)未定义
int l=0;
while((t=fr.read())!=-1){                   //没有为类型 FileReader 定义方法 read()
System.out.print((char)t);
}
fr.close();                                     //没有为类型 FileReader 定义方法 close()     
}catch(FileNotFoundException e){
System.out.print("找不到指定文件");

}
catch(IOException e3){
System.out.print("读取错误");


}
}}

解决方案 »

  1.   

    改个名字
    public class FileReaderTest {你自己的类覆盖了系统类 
      

  2.   

    我建议你使用eclipse 编译你的代码  eclipse 能够帮你找出你的错出在哪了。
      

  3.   

    你的FileReader() 没有构造方法,还有close()方法 read() 方法。 你可以试试
      

  4.   

    改个名字 
    public class FileReaderTest { 你自己的类覆盖了系统类 
      

  5.   

    首先你的类名覆盖了系统类,更换下类名。
    例如 public class FileOpreate {
    /**
         * 读取全部的文件内容
         * @param filePath
         * @param fileName
         * @throws IOException
         */
        public void readAllFile(String filePath,String fileName)throws IOException
        {
        
         FileReader fr=new FileReader(filePath+fileName);
         int count=fr.read();
         while(count!=-1)
         {
         System.out.print((char)count);
         count=fr.read();
         if(count==13)
         {
         fr.skip(1);
         }
        
         }
         fr.close();
        
        }
    }