import java.io.File;
public class FileRename {
public static void main(String[] args) {
File oldName = new File("copyfile");
File newName = new File("cpyFile2");
if (oldName.renameTo(newName)){
System.out.println("文件已重命名!");
}else {
System.out.println("Error!!!!!");
}
}
}