I'm practicing a few problems off my book and also read a section of my book talking about how to specify the file location. One way would bePrintWriter outputFile=new PrintWriter("A:\\PriceList.txt");
My problem occurs when I try to specify a file location as show below//Open an output file that appends data and does not delete it FileWriter append_data=new FileWriter("C:\\hello.txt",true); //Make a file that cvan print data into it PrintWriter outputfile=new PrintWriter(append_data);
Apparently, I believe this is not the right way to set my own path for the file...I'm just a novice in java so can anyone please explain to me how can I specify my file path.
One more question would be that suppose I want to specify the file location on Desktop. What the format for that?
Thanks in advance!