In what order are resources closed?try (Res a = new Res("A"); Res b = new Res("B")) { System.out.println("body"); } // Res.close() prints close(name)