0

in my main class

  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);
}

}

howeverwhen I open my file.csv, nothing is written ! What am I doing wrong ?

KJW
  • 15,035
  • 47
  • 137
  • 243

1 Answers1

2

Try to call writer.flush() at the end

maximdim
  • 8,041
  • 3
  • 33
  • 48