标签:gen 基本 str com not exce system package for
package com.study02;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class IOtest03 {
public static void main(String[] args) {
File src = new File("abc.txt");
FileInputStream is = null;
try {
is = new FileInputStream(src);
for (int i = is.read(); i != -1; i=is.read()) {
System.out.print((char)i);
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally {
if (is!=null) {
try {
is.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
}
标签:gen 基本 str com not exce system package for
原文地址:https://www.cnblogs.com/LuJunlong/p/11747642.html