getProperty的问题
String outputDirectory = System.getProperty("survey.dir");
//getProperty这个方法API上说返回这个KEY所对应该的值,如果没则返回NULL
(如果有是返回路径? 那是什么的路径? 是所有名为survey的路径?还是什么意思 感觉有点不清楚)
File outputFile = null;
if(outputDirectory != null) {
outputFile = new File(outputDirectory, "survey.out");
System.out.println("outputFile is not null");
}
else {
outputFile = new File("survey.out");
System.out.println("outputFile is null");
}
PrintWriter fileOut = new PrintWriter(
new FileWriter(outputFile.getAbsolutePath(), true));