我用Buffere写为什么找不到路径
public void writer(String content){
try {
BufferedWriter bw = new BufferedWriter(new FileWriter(new File("b.txt")));
bw.write(content);
bw.flush();
bw.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public String reader(){
String content = null;
try {
String line = null;
BufferedReader br = new BufferedReader(new java.io.FileReader(new File("b.txt")));
while((line=br.readLine())!=null){
content = line;
}
br.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return content ;
}
请指示谢谢