67,550
社区成员




FileReader fr = null;
BufferedReader br = null;
List<String> nameList = new ArrayList<String>();
List<String> phoneList = new ArrayList<String>();
try {
fr = new FileReader(new File("H:\\test.txt"));
br = new BufferedReader(fr);
String line = null;
String[] strs = null;
while ((line = br.readLine()) != null) {
strs = line.split("\\s+");
nameList.add(strs[0]);
phoneList.add(strs[1]);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (fr != null) {
try {
fr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}