I’m a writing a program that will determine the number of lines, characters, and average word length for a text file. For the program, the specifications say that the file or files will be entered as a command line argument and that we should make a TestStatistic object for each file entered. I don’t understand how to write the code for making the TestStatistic objects if the user enters more than one file.
Share
The most basic way to process command line arguments is:
The preferable way is to use something that manages the command line arguments for you. I suggest JSAP: The Java Simple Argument Parser.