java File renameTo

java File renameTo

String imgFilePath = "1.png";
String imgNewFilePath = "1.jpg";
File oldFile = new File(imgFilePath);
File newFile = new File(imgNewFilePath);

oldFile.renameTo(newFile);

 

####################

posted @ 2022-06-23 19:10  西北逍遥  阅读(77)  评论(0编辑  收藏  举报