outputting to a file java code example
Example 1: java create txt file
File myObj = new File("path");
myObj.createNewFile();
FileWriter myWriter = new FileWriter("path");
myWriter.write("text");
myWriter.close();
Example 2: write file from a specific location in java
File file = new File("Z:\\results\\results.txt");