Java tutorial
import java.io.File; public class Main { public static void main(String[] args) { // create new File objects File f = new File("C:/test.txt"); File f1 = new File("C:/testA.txt"); // rename file boolean bool = f.renameTo(f1); // print System.out.print("File renamed? " + bool); } }