PrintWriter output; output = createWriter("hello.txt");// Create a new file output.println("Hello there"); //write to the file output.flush(); // Writes the remaining data to the file output.close(); // Closes the file