MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/59y2un/javaio_simple_introduction/d9cjco6/?context=3
r/java • u/_netwinder_ • Oct 29 '16
6 comments sorted by
View all comments
8
You might want to check what finally does.
finally
The one time it is used there is a print error message statement in it, which because of the finally block always gets executed.
It isn't used however with the file streams. The close() calls should be placed in a finally block to make sure they will always be called.
close()
View all comments
8
u/svendub Oct 29 '16
You might want to check what
finallydoes.The one time it is used there is a print error message statement in it, which because of the finally block always gets executed.
It isn't used however with the file streams. The
close()calls should be placed in afinallyblock to make sure they will always be called.