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.