使用File类管理文件和目录 报错 是什么原因?
程序代码:
package hahari_1; import *; import java.util.*; public class filetext { public static void main(String[] args) { String Filename = "D:\\javapj\\ex.java"; File myfile = new File(Filename); if (!myfile.exists()) { System.out.println(Filename + "未找到!"); return; } if (myfile.isDirectory()) { System.out.println("文件对象" + myfile.getName() + "是目录"); File ds = new File("mydata"); if (!ds.exists()) { ds.mkdir(); System.out.println("目录" + ds.getAbsolutePath() + "创建结束"); } return; } if (myfile.isFile()) { System.out.println("文件对象" + myfile.getAbsolute Path()); System.out.println("文件字节数" + file.length()); System.out.println("文件是否能读" + myfile.can Read()); if (myfile.canWrite()) { { System.out.println("设置文件为只读" + myfile.set ReadOnly()); } System.out.println("文件是否可写" + myflie.can Write()); Date fd = new Date(myfile.lastModified()); System.out.println("文件上次修改时间" + fd.toString()); } } } }
"filetext.java": ')' expected at line 25, column 60
总共有4处报错。不清楚是什么原因?