I have an initialization file (initialize.java) that pulls in data from fileInput.txt using a fileInputStream, but both of them are in different directories.
Project/library/initialize.java Project/resources/text/fileInput.txt
my code in initialize.java is:
FileInputStream fstream = new FileInputStream("/resources/text/fileInput.txt");
But the file cannot be read. I've also tried
FileInputStream fstream = new FileInputStream("./resources/text/fileInput.txt");
But that didn't work too.
How can I access the txt file and what's the difference between using "./resources" and "/resources"?
Thanks for reading this.