I\'m writing an app that connect to a website and read one line from it. I do it like this:
try{
URLConnection connection = new URL(\"www.example.com
I think it will be better to place the closing methods in the finally block
Yes, always. Because an exception might occur and resources aren't released/closed properly.
You only need to close the most outer reader because it will be responsible for closing any enclosing readers.
Yes, it's ugly... for now. I think there are plans for an automatic resource management in Java.