throw处理异常

import java.io.FileReader;
import java.io.IOException;
import java.io.FileNotFoundException;
/**
使用throw处理异常
*/
public class CheckException02 {
public static void main(String[] args) throws IOException {
readMyFile();
}

  public static void readMyFile() throws IOException {
      FileReader reader = null;

      reader = new FileReader("d:/a.txt");
      
      char c1 = (char)reader.read();
      System.out.println(c1);

      if(reader!=null) {
          reader.close();
      }
  }
}
上一篇:数据可视化整理


下一篇:wkt区域围栏