I know how to write file to the specified directory by doing the following:
public void writefile(){ try{ Writer output = null; File file = new File("C:\\results\\results.txt"); output = new BufferedWriter(new FileWriter(file)); for(int i=0; i<100; i++){
But how can I specify a directory if the directory is specified in the method? For example, a method called getCacheDirectory() . Assuming all necessary imports, etc. Were made..
Thanks:).
source share