3 ms·
..and that Java has, like the object oriented language that it is, an AutoCloseable interface which you can implement and then use in blocks, much like with thi
by gregopet 6y ago
..and that Java has, like the object oriented language that it is, an AutoCloseable interface which you can implement and then use in blocks, much like with this Python construct.
- cbsmith 6y agoIn fairness, Java's AutoCloseable interface is missing some of the niceties of ExitStack, as with C++'s destructors. People have made libraries for both that attempt to close the gap.