小白在学习IO流时遇到以下问题:
若对象关联的文件没有路径,write()会将数据“abcdefg”写入到什么路径?
public class BufferedWriterDemo {
public static void main(String[] args)throws IOException {
FileWriter fw = new FileWriter("bufDemo02.txt");
BufferedWriter bufw = new BufferedWriter(fw);
for (int x = 1; x < 8; x++) {
bufw.write("abcdefg"+x);
bufw.newLine();
}
bufw.close();
}
}
请路过的学长前辈,指点迷津 ! |
|