question: public static void writeFileTxt ( String fileName , String [ ] totalFile ) throws IOException { try ( final Writer writer = Files . newBufferedWriter ( Paths . get ( fileName ) , Charset . forName ( "UTF-8" ) ) ; PrintWriter pw = new PrintWriter ( writer ) ) { for ( String file : totalFile ) { pw . println ( file ) ; } } }
target:  Method to get the file name (or path relative to the directory) and file to write to in the form of an array of strings where each string represents a line.