Andrey said about try-with-resources as a dedicated language feature. use() standard library function have been available for a long time.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Try-with-resources: the Kotlin way?
|
5 | 7663 | November 21, 2014 | |
Kotlin needs try-with-resources | 56 | 38239 | September 10, 2020 | |
[SOLVED] Try with resources with `AutoClosable` | 3 | 6431 | December 7, 2017 | |
Concise way to manage resource with exception in kotlin | 11 | 10387 | December 5, 2017 | |
Is there standard way to use multiple resources? | 5 | 9925 | February 19, 2021 |