Java, Software DevelopmentJava – Rename a file Using a File Object Example To rename a file , use the renameTo method in java.io.File.