Tuesday, 18 March 2014

Java Program for Rename File

// rename file

import java.io.File;

class RenameFile
{
    public static void main(String args[])
    {
        File f=new File("c:\\kunal.txt");
        if(f.exists())
        {
            f.renameTo(new File("c:\\amol.txt"));
        }
    }
}

No comments: