r/learnprogramming 1d ago

Question about Files.lines() with try-with-resources in Java

[deleted]

1 Upvotes

2 comments sorted by

View all comments

2

u/GeorgeFranklyMathnet 1d ago

You're right to use try-with-resources on a file I/O stream, says Baeldung and other reliable sources.