This question is a duplicate of this question but none of them answered if it can be closed.
They only suggested alternatives- using try-with
or actually having a reference like Scanner scanner=new Scanner(System.in)
.
This led to me thinking that unreferenced Scanner objects can't be closed but...
Question: Shouldn't the objects become eligible for garbage collection and thus will be closed ultimately?
(Note: I do realise that depending on the GC isn't a great idea)