- import java.io.*;
- class Filewriter {//因为此处LZ把名称也写成了“FileWriter”占用了java预先定义的类,修改下即可
- public static void main(String[] args) throws IOException{
- FileWriter fw=new FileWriter("d:\\demo.txt");//为什么老提示构造函数FileWriter未被定义?菜鸟,求解释
- fw.write("haha");
- fw.flush();
- }
- }
复制代码 |
|