title: How can I get a string from the user in java?
body: <p>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?</p>
  
  <pre><code>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);
  </code></pre>