How should file names be specified in Java programs?
While not required, the graders would be grateful if you also kept the following things in mind Java is meant to be portable but it allows file paths to be system dependent. For example, the command new File(“sourcefiles\datafile1.txt”) will only function properly on a Windows machine. Consider the following alternatives for hard coding path names: new File(new URI(“sourcefiles/datafile1.txt”)) new File(“sourcefiles”, “datafile1.txt”) new File(“sourcefiles”+File.pathSeparator+”datafile1.txt”) Alternatively, do not hard code paths. Keep them in an external file, or allow the user to specify them on the command line (making note of this in your report). When zipping your files for submission, zip a directory containing your files rather than the files themselves. Not hard coding filenames is a good thing. It makes your code and your program modular. However, assignments often include large lists of files. If you avoid hard coding filenames, please don’t make your grader type in all the f