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
"Java has no lifetime for an object, this is managed by the garbage collector." -Not entirely true. It's firstly 'managed' by the way a program is written. If an object is out of scope, GC will most likely take care of it.
If you don't close br, it will live until the program exits unless collected by GC if ready for collection. It doesn't leak, just a long living variable.