Campbell Ritchie wrote:That method is incomplete because you are not closing the Reader in a finally block.
Ah, this encourages me to a question that - being a newbie - I haven't solved myself yet:
When I use this:
I get a compiler error, because "input.close()" throws an exception which must be handled. How can I guarantee the freedom of the used system resources? One way would be to add another try-catch-clause:
That would compile but if an error during closing happens there is no way to free the resources. Is there any method I overlooked which simply deallocates the resources bound and does nothing else? Or is "close()"
*it* and an error could only occur during a major earthquake or large sun flares?