JAVA学习日报 8.9

电脑还没活过来,据说明天会送到家

没办法只能继续手机照着教材一个字一个字打加深印象,如果明天电脑还没活过来我就去网吧

咱们先看看File类内的常用方法吧

判断文件属性方法
exist(): boolean 
canRead(): boolean
canWrite(): boolean
canExecute(): boolean
isDirectory(): boolean
isFile(): boolean
isAbsolute(): boolean
isHidden(): boolean
获取文件路径、名称等信息的方法
getAbsolutePath(): String
getCanonicalPath(): String
getName(): String
getPath(): String
getParent(): String
lastModified(): long
length(): long
实际操作方法
listFile(): File[]
delete(): boolean
renameTo(dest: File): boolean
mkdir(): boolean 
mkdirs(): boolean  
View Code

其中还有和Linux一样的文件夹操作是很令我惊喜的,好像摸到了安装包程序的一点点方向

原文地址:https://www.cnblogs.com/Sakuraba/p/13463981.html