Using the LineNumberReader class

LineNumberReader is a subclass of the BufferedReader class and allows you to keep track of which line you’re currently processing.
It also enables you to alter the current line number if you wish to start from another number.
This example constructs a LineNumberReader object for a file and reads each line until the end of file is reached.
Each line is printed out along with the line number.

Continue reading