[IO]——File对象
2016-04-04 02:23
344 查看
public class demo02 { public static void main(String[] args) { String parentPath="E:/others"; String name="w.png"; //以相对路径构建 File src=new File(parentPath, name);//以相对路径构建 src=new File(new File(parentPath), name); System.out.println(src.getName()); System.out.println(src.getPath()); //绝对路径 src=new File("E:/others/w.png"); //没有指定盘符:以user.dir构建 src=new File("test.txt"); src=new File(".");//以当前路径 System.out.println(src.getAbsolutePath()); } }
相关文章推荐
- Mysql IO 内存方面的优化
- Node.js 的异步 IO 性能探讨
- SQL Server误区30日谈 第22天 资源调控器可以调控IO
- mysql 数据同步 出现Slave_IO_Running:No问题的解决方法小结
- java中的Io(input与output)操作总结(一)
- GO语言的IO方法实例小结
- java中的Io(input与output)操作总结(四)
- C#路径,文件,目录及IO常见操作汇总
- SQL语句实现查询当前数据库IO等待状况
- Java进阶教程之IO基础
- java中的Io(input与output)操作总结(三)
- Java 1.0和Java 1.1 的IO类的比较
- JAVA IO API使用详解
- Java NIO和IO的区别
- Java编程中最基础的文件和目录操作方法详解
- Python中使用select模块实现非阻塞的IO
- Python通过poll实现异步IO的方法
- Python通过select实现异步IO的方法
- Java编程中字节流与字符流IO操作示例
- STM32 IO口双向问题