I\'ve read through some of the Java garbage collection guides online, but I\'m still a bit unclear and wanted to make sure so that I don\'t have memory leaks in my code.
Yes - the behaviour is as you describe. The general rule for garbage collection is that objects only become eligible when you cannot reach them through any hard reference. Any objects you can reach this way will thus never be garbage collected (with the exception of soft / weak references.)