public class Demo5_LineNumberReader{
public static void main(String[] args) throws IOException{
LineNumberReader lnr = new LineNumberReader(new FileReader("zzz.txt"));
String line;
lnr.setLineNumber(100); //设置行号从100 开始
while((line = lnr.readLine()) != null){
syso(lnr.getLineNumber()+":"+line); //获取行号getLineNumber()
}
lnr.close();
}
}