import java.io.*;
public class Test10_18 {
public static void main(String[] args){
try {
ReaderStream rs=new ReaderStream(new FileReader("src\\Test10_18.java"));
rs.paintFile();
} catch (FileNotFoundException e) {}
}
}
class ReaderStream{
public FileReader fw;
ReaderStream(FileReader fw){
this.fw=fw;
}
public void paintFile(){
BufferedReader br=new BufferedReader(fw);
int num=0;
String str=null;
try {
while((str=br.readLine())!= null){
System.out.println(num+++":"+str);
}
} catch (IOException e) {}
}
}
|
|