writing to a file | has syntax //Instantiate a stream, and a PrintWriter FileOutputStream streamVariableName = new FileOutputStream(fileNameOrPath); PrintWriter printerVariableName = new PrintWriter(streamVariableName) //Write a string to the file printerVariableName.print(string); //Write a string and a newline to the file printerVariableName.println(string); //Close the file streamVariableName.close(); |  |