io流操作之文件重命名代码
2015-12-13 20:48
246 查看
import java.io.File; public class TestFile { public static void main(String[] args){ File file1 = new File("D:\\io\\helloworld.txt"); System.out.println(file1.getAbsoluteFile()); File file2 = new File("D:\\io\\hello2.txt"); //rename()方法要求file1一定存在,file2一定不存在 Boolean b = file1.renameTo(file2); System.out.println(b); } }
相关文章推荐
- java IO流文件的读写具体实例
- 装饰类设计模式 【不完善版】 IO流
- IO流操作规律 转码
- 重置标准输入输出流 IO流
- 【Java基础】IO流操作
- 【代码练习】学生成绩排名--涉及IO流和集合
- JAVA基础-IO流
- IO(输入输出流) 4000
- Java培训-IO流补充
- IO流操作规律(一)
- 黑马程序员————————IO流 FileWriter类 和 FileReader类的一些基本用法
- 黑马程序员--Java基础--IO流
- io 学习
- javaIO继承关系
- io流(一)
- 黑马程序员—装箱拆箱与IO流重点
- 黑马程序员——java基础——IO流(2)File类,IO常用流对象及IO包中其他类
- 黑马程序员_java中IO流的操作规律
- 黑马程序员-java基础-IO流中的字节流和字符流
- 参加某培训机构Java培训记录(七)