在我的主要班级
public static void main(String[] args) {
CSVWriter writer = new CSVWriter(new FileWriter("D:\\myfilefile.csv"), '\t');
recursiveLoop(writer, 10);
}
public void function recursive(CSVWriter writer, int index){
if (index == 0){
return;
}else{
String[] entries ="TEST#LINE#".split("#");
writer.writeNext(entries);
index--;
recursiveLoop(writer, index);
}
}
然而,当我打开我的file.csv时,什么都写不出来!我做错了什么?
答案 0 :(得分:2)
尝试在最后调用writer.flush()