我正在使用Eclipse编写需要写入输出文件的代码。文件名来自命令行参数。我不知道它是在哪里创建文件的。它说我的工作区是输出文件的默认位置,但却找不到它。这是我的代码
try{
PrintWriter output = new PrintWriter(new File(args[3]));
//System.out.print(args[3]);
output.append('l');
output.close();
} catch(IOException e) {
System.exit(0);
}发布于 2012-11-27 08:13:57
将以下内容添加到程序中,以查看文件的绝对路径。
File file = new File(args[3]);
System.err.println( "File: " + file.getAbsolutePath() );https://stackoverflow.com/questions/13571301
复制相似问题