I am using the code below to get a string in Java to use it as a file path, but it has an error. I checked tat the address is correct but I don’t know what the exact problem is?
String filename;
System.out.print("please write down the address of your specefic file:(please insert double '\\'instead of one '\')");
Scanner input=new Scanner(System.in);
filename=input.nextLine();
File n=new File(filename);
System.out.print(n.getPath());
compress(n);
You should enter you input normally, not with double
\\. The java code you are invoking to create the file will take care of correctly escaping the\characters.