天天看點

Java 設定檔案隻讀

import java.io.File;

public class FileReadOnly {
    public static void main(String[] args) {
        File file = new File("cpyFile2");
        file.setReadOnly();
        System.out.println(file.canWrite());
    }
}