Will stream classes or connections considered as a resource leak in Java
Java has no lifetime for an object, this is managed by the garbage
collector. And if I use some IO classes without closing it, or some
DBConnection, will this considered a resource leak? In another words, will
IO object be collected and destroyed by garbage collector, AFAIK, the
garbage collector is for memory only. For example:
BufferedReader br = new BufferedReader( new FileReader( new File("path") ) );
No comments:
Post a Comment