David - yes, that's a good example. These things behave differently on different operating systems and for different programs, but that sort of thing is not uncommon.
Another issue is that your operating system may get unhappy if you have too many open files at once - it's a drain on system resources, and there may be a limit set on how many you can have at once. Usually this number is fairly high (in the thousands) but if you're doing something that opens a LOT of files, it can be helpful to close each one promptly when you're done with it.
In general, for many of the times you use a resource and forget to close it, there may not be any negative consequence. At least, not right away. But then something will happen later on, and it may be hard to debug what is going on, and eventually it turns out that it's because you didn't close that thing you were supposed to close. And so it's much easier to just get in the habit of closing things when you're done with them, always. So you can spend your time debugging other errors, instead.
David Blaine wrote:Are there any other types of connectors, besides file and DB ?
Sockets and JMS come to mind. I'm sure there are others. You could look at the java.io.Closeable interface, and see all the classes that implement it.