public void open() throws IOException {
  writer=new PrintWriter(new BufferedWriter(new FileWriter(filename)));
  writer.println(columnNames);
}

public void open ( ) throws IOException { writer = new PrintWriter ( new BufferedWriter ( new FileWriter ( filename ) ) ) ; writer . println ( columnNames ) ; }
open the file and write the column titles .
