ä¾å¤ã«ã¤ãã¦è²ã ã¨èãã¦ã¿ã - ãããããã® ãä¾å¤ã¨ RAII ã¤ãã£ãªã ãã§ã®èããããtryOpen æ¹å¼ããããå°ãã ãç ®è©°ãã¦ã¿ãã ãªã½ã¼ã¹ãä¿æããã¯ã©ã¹ã¯ã³ã³ã¹ãã©ã¯ã¿ã§ä¾å¤ãæããªã Java ã§ã¯ããªã½ã¼ã¹ã確å®ã«è§£æ¾ããããã«ãtry-finally ãç¨ããå¿ è¦ãããã FileInputStream fin = null; try { fin = new FileInputStream(fileName); ... } finally { if (fin != null) fin.close(); } ããã¯ãã³ã³ã¹ãã©ã¯ã¿ãä¾å¤ãéåºããå ´åã§ããªã½ã¼ã¹ã解æ¾ããå¿ è¦ãããããã ããã³ã³ã¹ãã©ã¯ã¿ã§ä¾å¤ãæããªãããã«ãã¦ããã°ã以ä¸ã®ããã«è¨è¿°ãããã¨ãã§ããã FileInputStream2 fin = new FileInputStream2(file
{{#tags}}- {{label}}
{{/tags}}