Banu Chowdary wrote:The return value is true. I didn't get the point. Can you explain it a bit clear...
You need to use the return value to determine if the rename operation succeeded. And the reason for this is...
1) Why f.getName is returning same name even after renaming it to new.java
The File class is used to represent a particular file with a specific filename. Calling the rename method will rename the file that is represented by the File object to a different name. It doesn't change the value of the File object.
Henry