【发布时间】:2014-07-17 23:03:24
【问题描述】:
我的 PrintWriter 对象编写器的 print() 方法不起作用,我导入了所有适当的类,但 CSV 文件总是空白。谁能告诉我为什么?
public class StateStats {
static String pathto = "....";
public static void main(String[] args) throws FileNotFoundException, IOException {
ReadFile st = new ReadFile(pathto+"stateAbbrev.csv");
ReadFile abPop = new ReadFile(pathto+"AbbrevPop.csv");
ReadFile Perc = new ReadFile(pathto+"PopPercentAlpha.dat");
PrintWriter writer = new PrintWriter(pathto+"StateAbbPop.csv","UTF-8");
//this is the header for our new CSV file
writer.write("State, Abbrev, Population, %of US");
writer.write("\n");
}
}
【问题讨论】:
标签: java javascript methods printwriter