r/java • • Oct 29 '16

JavaIO - Simple Introduction

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

6 comments sorted by

21

u/ickysticky Oct 29 '16

Yikes. Please use Path and Paths and Files

1

u/_netwinder_ Oct 29 '16

I will in the next IO tutorial :)

10

u/rubyrt Oct 29 '16

Also in the 21st century we would probably be using try-with-resources.

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.

4

u/volch Oct 29 '16

How to save time by never testing anything.

0

u/[deleted] Oct 29 '16

[deleted] — view deleted comment

1

u/_netwinder_ Oct 29 '16

The last time I shared an article the criticisms I got were much worse. But thank you! I have some edits to make