确定是否可以写入文件
//nowjava import java.io.*; public class Main { public static void main(String[] args) { String filePath = "C:/Folder/ReadText.txt"; File file = new File(filePath); if(file.canWrite()) { System.out.println("File " + file.getPath() +" can be written"); } else { System.out.println("File " + file.getPath() +" can not be written"); }/** 来 自 时 代 J a v a 公 众 号 - nowjava.com**/ } }