06 输入输出.ppt

06 输入输出

第九章 输入输出 章节内容 File 输入流:InputStream、Reader 输出流:OutputStream、Writer、Writer应用 序列化 压缩:文件、目录 第九章 输入输出 9.1 File(java.io.File) 表示一个文件或目录,并不一定实际存在,可能还没有创建。如果存在,可以访问其属性。 (1) 创建一个File对象 File(File parent, String child) File(String pathname) File(String parent, String child) File file=new File(c:/windows); File file=new File(c:/windows,system32); 9.1 File (2) File中的方法 是否有访问文件的权限:boolean canExecute(),boolean canRead(),boolean canWrite() 文件路径:boolean isAbsolute(),File getAbsoluteFile(),String getAbsolutePath() ,String getPath() 父目录: String getParent(),File getParentFile() 指向的是文件还是目录:

文档评论(0)

1亿VIP精品文档

相关文档