In a recent thread I found there is surprisingly disagreement among Java developers on how resources should be cleaned up. And here I'm trying to summarize my thoughts. At work, I found myself almost always see code that does not close resources properly. Here are a few examples: 1. Connection conn = ...; //use conn Obviously, the resource is never closed and hence directly result in resource-leak