Java修改文件名
一、
public class xfile { /** * @param args */ public static void main(String[] args) { // TODO 自动生成方法存根 File f=new File("d:/old.txt"); String c=f.getParent(); File mm=new File(c+File.pathSeparator+"new.txt"); if(f.renameTo(mm)) { System.out.println("修改成功!"); } else { System.out.println("修改失败"); } } } 本篇文章来源于:开发学院 http://edu.codepub.com 原文链接:http://edu.codepub.com/2010/0204/20323.php