public static void main(String[] args) {
// 封装数据源
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader("Test1.java"));
String line = null;
while ((line = br.readLine()) != null) {
System.out.println(new String(line));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
|