Are you asking about escape character issues?
If that is the case then use forward slashes instead of backward slashes like
"C:/Users/You/Desktop/test.txt"
instead of
Answer from Brendan on Stack Overflow"C:\Users\You\Desktop\test.txt"
Videos
Are you asking about escape character issues?
If that is the case then use forward slashes instead of backward slashes like
"C:/Users/You/Desktop/test.txt"
instead of
"C:\Users\You\Desktop\test.txt"
If you know the name of the file, of course it's simply
new File("./myFileName")
If you don't know the name, you can use the File object's list() method to get a list of files in the current directory, and then pick the one you want.
I've been using
Scanner Scan = new Scanner(new File("path"));for the past month or so and today I learnt abt using
Scanner Scan = new Scanner (Path.get("file"));What exactly is the difference? and which one should you use?