try-with-resources 적용 후기
JDK 1.7 버전 부터 추가된 try-with-resources. 이런게 있다 정도만 알았고, 언제 사용하는지 정확히 몰랐다. 1. try-with-resources가 생겨난 배경 public static void main(String[] args) { DataInputStream dataInputStream = null; FileInputStream fileInputStream; try { fileInputStream = new FileInputStream("score.dat"); dataInputStream = new DataInputStream(fileInputStream); } catch (FileNotFoundException e) { e.printStackTrace(); } finally {..
Programming/Java
2023. 3. 17. 15:46
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday