Hi,
 
I am attaching a code down where I am renaming file. it works fine if  I am not giving the path but when I include path its giving error can somebody help me out  in this
 
David

import java.io.*;

import java.util.*;

public class test

{

public static void main(String args[])

{

try

{

File fil=new File("hello.txt");

if( fil.exists () )

System.out.println( "Exists");

if( fil.renameTo(new File("hello1.txt")) )

System.out.println( "Succeeded");

else

System.out.println( "Failed");

}

catch(Exception e){}

}

}

Reply via email to