Am I using the Java 7 try-with-resources correctly
问题 I am expecting the buffered reader and file reader to close and the resources released if the exception is throw. public static Object[] fromFile(String filePath) throws FileNotFoundException, IOException { try (BufferedReader br = new BufferedReader(new FileReader(filePath))) { return read(br); } } However, is there a requirement to have a catch clause for successful closure? EDIT: Essentially, is the above code in Java 7 equivalent to the below for Java 6: public static Object[] fromFile