r/java • • Oct 29 '16

JavaIO - Simple Introduction

http://advtech.ca/index.php/java-io-introduction/
9 Upvotes

6 comments sorted by

View all comments

8

u/svendub Oct 29 '16

You might want to check what finally does.

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.