In java, it automatically freeing up memory resouces by GC.But we have not only memory resources, also having non memory resources like Database connections, network connections, file handles.So,which is also needs to be released (not just garbage-collected) when you’re finished with it.
So, My question is, what are the problems we may face if we not handling(freeing) non-memory resources in java?
Please guide me to get out of clear idea about this…
An example is that.
When you use some APIs like FileInputStream.This is the one of the non-memo resource as you call.When you finish reading something from a file,and you forget to close it,then the system will occupy this file util the programs ends.During the occupation period,you may NOT open this file.That’s the problems.