Join the Community Java Q&A

Tag: renameTo

Rename a File in Java

To rename file name, we use  method in file. Call method on old file handle and pass new file handle to the method as parameter. Using method we can also move file from one directory to the other desired directory …