This is my homework, but please read my problem description first.
I have to write a Java program as
a. Path of the directory will be passed to the program as command line argument. Then program will prompt for a file name and find all the files with that name.
If no argument is passed, program should search directory from previous run. Do not use any database.
b. If user types exit/quit/bye, program will stop execution.
Problem description:
*My problem is that question says that I have to take directory name from command line and if it is not passed I have to take previous entered directory. But when we pass command line argument we need to run the program. It means each time I have to run the program to pass command line args. So how can I remember the previous one if argument not passed (as in question I can’t use database). *
I don’t really understand what do you mean with “program should search directory from previous run”. So i will try to answer 2 possibilities :
previous run from the same session. ( that just being run )
previous run from same/different session ( means maybe run yesterday, or last month, or last year ) and the computer might have been turned off between each run.