BufferedReader in=new BufferedReader(new FileReader("C:\\Users\\Administrator\\Desktop\\通讯录.txt"));
String name="";
int number=1;
while((name=in.readLine())!=null){//循环从文件中读取数据
System.out.println(number+"、"+name+"\n");//将读取的数据显示在文本域中
name=new String(name);
number++;
}
in.close();