zoukankan      html  css  js  c++  java
  • java中如何创建带路径的文件

    请教各位大侠了,java中如何创建带路径的文件,说明下 这个路径不存在

    ------回答---------
    ------其他回答(2分)---------
    Java code
    File f = new File("c:/1.txt"); if(!f.exists()){ try { f.createNewFile(); } catch (IOException e) { e.printStackTrace(); } }
    ------其他回答(18分)---------
    Java code
    File file = new File("c:\123\123.txt"); if(!file.getParentFile().exists()) file.getParentFile().mkdirs(); file.createNewFile();
    ------回答---------
    ------其他回答(2分)---------
    Java code
    File f = new File("c:/1.txt"); if(!f.exists()){ try { f.createNewFile(); } catch (IOException e) { e.printStackTrace(); } }
    ------其他回答(18分)---------
    Java code
    File file = new File("c:\123\123.txt"); if(!file.getParentFile().exists()) file.getParentFile().mkdirs(); file.createNewFile();
     
     
     
     
    http://biancheng.dnbcw.net/java/180676.html
     
     
    http://biancheng.dnbcw.net/java/
  • 相关阅读:
    SVG.js 文本绘制整理
    SVG.js 基础图形绘制整理(二)
    SVG.js 基础图形绘制整理(一)
    C# 异步编程Task整理(一)
    Svg.Js 父类的基础操作
    Svg.Js A标签,链接操作
    Svg.Js 简介(转)
    SVG 相关整理
    Kendo UI
    Kendo UI
  • 原文地址:https://www.cnblogs.com/pengmn/p/6596874.html
Copyright © 2011-2022 走看看