package LineNumberReader;
import java.io.*;
public class LineNumberReader
{
public static void main(String[] args) throws IOException
{
FileReader fr = new FileReader("Arraytest.java");
LineNumberReader lnr = new LineNumberReader(fr);
String line = null;
while((line = lnr.readLine()!= null)
{
System.out.println(lnr.getLineNumber():+" "+line);
}
}
}
|
|