String str;
String path = "E:/progs/a.txt";
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(path);
while(true)
{
System.out.print("Enter the words : ");
str = br.readLine();
if(str.equalsIgnoreCase("exit"))
break;
else
pw.println(str);
}
我输入的文本没有写入路径中指定的文件名 a.txt....我可以知道原因吗