public static void main(String[] args) {
demo1();
File file1 = new File("D:\\workspace\\xxx.txt");
file1.setReadable(false);
System.out.println(file1.canRead());
file1.setWritable(false);
System.out.println(file1.canWrite());
file1.setExecutable(false);
System.out.println(file1.canExecute());
} |