If for whatever reason the println() method were to throw an ex=
ception, the eachLine() method ensures that the file resource is c=
orrectly closed. Similarly if an exception occurs while reading, the resour=
ce will be closed too.

=20

If you wish to use a reader/writer object or an input/output stream obje=
ct there are helper methods to handle the resource for you via a closure - =
which will automatically close down any resource if an exception occurs. e.=
g.