Results 1 to 2 of 2
- 07-25-2009, 08:18 PM #1
Member
- Join Date
- Jul 2009
- Posts
- 10
- Rep Power
- 0
Question about File renameTo() method : Abnormal output
public static void main(String[] args) throws Exception
{
File fl1 = new File("D:/Education/Java/Test1");
File fl2 = new File("D:/Education/Java/Test2");
fl1.renameTo(fl2);
p("New File Name is : "+ fl1.getName());
}
For the above code snippet O/P is
run:
New File Name is : Test1
BUILD SUCCESSFUL (total time: 2 seconds)
My question is :
At my system although the Test1 gets renamed as Test2 after compilation but still fl1.getName() returns the old name Test1. Why so?
- 07-25-2009, 08:22 PM #2
Similar Threads
-
problem with output of jar file
By nishant.4545 in forum Advanced JavaReplies: 2Last Post: 07-04-2009, 04:00 PM -
No output to file
By shiva in forum Java ServletReplies: 0Last Post: 04-24-2009, 02:06 PM -
Output to a text file
By sfe23 in forum New To JavaReplies: 4Last Post: 03-26-2009, 10:44 PM -
Search a word(taken from one file) in another file and give the line as the output
By SwapnaNaidu in forum New To JavaReplies: 7Last Post: 11-19-2008, 02:09 PM -
invoking method and output questions
By bluekswing in forum New To JavaReplies: 1Last Post: 08-06-2007, 06:36 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks