Testlinenumbering accepts one command-line argument


Discus the below:

TestLineNumbering that accepts one command-line argument, the name of the file. Your code should verify that a single command-line argument was specified.

Declare a variable that holds a File object which is initialized from the file named in the first command-line argument.

Within a try-catch block, create:

- a buffered, input stream reader based on the System.in stream (Standard input).

- a print file writer based on the File reference.

- a while loop that reads each line from the console input stream and prints the line out to the file prepended with the count of the line number.

Close the I/O streams.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Testlinenumbering accepts one command-line argument
Reference No:- TGS01938058

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)