Skip to content

Tag: output

Using both FileInputStream and FileOutputStream

I am stuck on my problem where I have to read a file given by the user and then calculate names, grades, and such. But the issue I am having is that I need to take that data and store it in a text file names report.txt and then take the data from the first file and then compute the

Java output: can’t write to subdirectory

How can I write to a file in a subfolder? Other answers on here said to use Paths, but no luck. In my code, for whichFileToSaveTo, if I remove “/Subfolder/” from it, my code works correctly and writes to the file. With “/Subfolder/”, I get a java.io.FileNotFoundException. I am using Wi…