//读取文件
LineNumberReader br=new LineNumberReader(new FileReader("s.txt"));
//从10开始
br.setLineNumber(10);
String line=null;
while((line=br.readLine())!=null){
System.out.println(br.getLineNumber()+":"+line);
}
结果:
11:lsnonllanfaldjdlas
12:sadklfjl
13:asldfksl
14:lksdflksl
15:lsjf;kl