import java.io.File;
import java.io.IOException;
public class CreateFile {
public static void main(String[] args) throws IOException {
File file = new File("cpyFile2");
File file1 = new File("src/test.txt");
if (file.compareTo(file1) == 0)
System.out.println("文件路经一致!");
else
System.out.println("文件路经不一致!!!!");
}
}
![img_f74f4a990242dd6f8e13990f81ac19c4.png](https://yqfile.alicdn.com/img_f74f4a990242dd6f8e13990f81ac19c4.png?x-oss-process=image/resize,w_1400/format,webp)