writeFile
public java v1 · immutableimport java.io.*;public class writefile{ // Main method public static void main (String args[]) { // Stream to write file FileOutputStream write; try { // Open an output stream write = new FileOutputStream ("PayRecord.txt"); // Print a line of text new PrintStream(write).println ("passed In"); // Close our output stream write.close(); } // Catches any error conditions catch (IOException e) { System.err.println ("Unable to write to file"); System.exit(-1); } } }