Advertisement
Guest User

Untitled

a guest
Apr 25th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. // 2020/4/25(土)
  2.  
  3. import java.io.*;
  4.  
  5. public class ExceptionTest {
  6. public static void main(String[] args) {
  7. FileReader fr = null;
  8. BufferedReader br = null;
  9. String line = null;
  10. try(fr = new FileReader("matrixA.txt");
  11. br = new BufferedReader(fr);) {
  12. while((line = br.readLine()) != null) {
  13. System.out.println(line);
  14. }
  15. } catch(FileNotFoundException e1) {
  16. e1.printStackTrace();
  17. } catch(IOException e2) {
  18. e2.printStackTrace();
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement