## Notes `try with resources` serves as a replacement for `try-catch-finally`. ```java // Before try { Writer writer = new PrintWriter(); // do work } catch (Exception e) { // handle exception } finally { writer.close(); } // now try (Writer writer = new PrintWriter()) { // do work } catch (Exception e) { // handle exception } ```