Question: Write a program (in Java) that prompts the user to enter a file name. The program checks whether the file exists. If so, change the

Write a program (in Java) that prompts the user to enter a file name. The program checks whether the file exists. If so, change the file name by appending the date and time to the file. Pass the filename from the command line. Here is a sample run of the program:

java RenameFile c:\temp\Test.txt

Success. New file is c:\temp\Test.txtThu Aug 29 13_54_11 EDT 2013

java RenameFile c:\temp\Test.txt

The file does not exist

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!