The path of the copy should be noted

When loading a disk file through the java File object, the file cannot be found (and the file clearly exists), the following code:

 

File file1 = new File("‪C:\\Users\\hqq\\Desktop\\audit.log");

System.out.println(file1.exists());

 

The solution at this time is to manually enter the path information again, and don't believe your eyes (although it looks right to the naked eye, but due to coding problems, the program thinks it is different)

 

Such as common operations, under Windows, the file right-click properties, copy the address.


 

 

 

 

 

 


 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326476296&siteId=291194637