zoukankan      html  css  js  c++  java
  • File类

    File类

    • File testFile = new File("xxx")
      File对象指代的是文件或者文件夹,对象是存储在内存中,当显示调用.createNewFile()才会在硬盘中创建出文件。

    .exist() 判断当前
    .isFile()
    .isDirectory()

    .mkdir()
    .mkdirs() 可以创建完整的路径文件(多层结构)

    使用示例

    File testFilePath = new File("D:/test/file");
    File testFile = new File("D:/test/file/11.java");
    if(!testFile.exists()){
        testFilePath.mkdirs();
        testFile.createNewFile();
    }
    
  • 相关阅读:
    keepass
    gpg
    Wireshark实践
    ssh
    namp
    第十二周
    第十一周
    第十周总结
    第九周学习总结
    编程语言
  • 原文地址:https://www.cnblogs.com/Vonadam/p/6344522.html
Copyright © 2011-2022 走看看