博客
关于我
Day53.File类的实例化 -Java常用类、集合、IO#
阅读量:334 次
发布时间:2019-03-04

本文共 1184 字,大约阅读时间需要 3 分钟。

Java File????????Java??????????????????????File????????????????????File???????????

File???java.io???????????????????????????????????File?????????????????????????IO???

1. ??File??

File???????????????

  • ???????File(String filePath)
    ???????????????????File????????????????????????????????????????????
    • Windows???????\\
    • Unix????URL??????/

???

File file1 = new File("Hello.txt"); // ????File file2 = new File("D:\\Note\\src\\com\\he.txt"); // ????
  • ????????File(String parentPath, String childPath)
    ??????????????????????????????????
File file3 = new File("D:\\Note\\src", "com");
  • ????????File(File parent, String childPath)
    ??????File?????????????????????????
File file4 = new File(file3, "he.txt");

2. ????

???File?????????????

  • ??????????????File????????????????????

    ?IDEA???????????????Module????????????????????
    ?Eclipse??????????????????????????????

  • ????????????????D:\????????http://www.example.com????????????????

3. ?????

??????????????????

  • Windows????????\\
    ???D:\MyFolder\MyFile.java
  • Unix???????/
    ???/home/user/MyFolder/MyFile.java
  • URL???????????????URL?????????????/

????????Java??File?????????????????????????????????????????????

???????????????????????File??????????Java??????????

转载地址:http://cuoq.baihongyu.com/

你可能感兴趣的文章
Netty事件注册机制深入解析
查看>>
Netty原理分析及实战(四)-客户端与服务端双向通信
查看>>
Netty客户端断线重连实现及问题思考
查看>>
Netty工作笔记0006---NIO的Buffer说明
查看>>
Netty工作笔记0007---NIO的三大核心组件关系
查看>>
Netty工作笔记0011---Channel应用案例2
查看>>
Netty工作笔记0013---Channel应用案例4Copy图片
查看>>
Netty工作笔记0014---Buffer类型化和只读
查看>>
Netty工作笔记0020---Selectionkey在NIO体系
查看>>
Vue踩坑笔记 - 关于vue静态资源引入的问题
查看>>
Netty工作笔记0025---SocketChannel API
查看>>
Netty工作笔记0027---NIO 网络编程应用--群聊系统2--服务器编写2
查看>>
Netty工作笔记0050---Netty核心模块1
查看>>
Netty工作笔记0057---Netty群聊系统服务端
查看>>
Netty工作笔记0060---Tcp长连接和短连接_Http长连接和短连接_UDP长连接和短连接
查看>>
Netty工作笔记0063---WebSocket长连接开发2
查看>>
Netty工作笔记0070---Protobuf使用案例Codec使用
查看>>
Netty工作笔记0077---handler链调用机制实例4
查看>>
Netty工作笔记0084---通过自定义协议解决粘包拆包问题2
查看>>
Netty工作笔记0085---TCP粘包拆包内容梳理
查看>>