In Java, if I have a linked list and I set its head = null, will the garbage collector be able to collect the whole list. As in this case just the head is losing reference but the nodes after head have a reference because of the previous nodes, so do they also get garbage collected?
Thanks in advance.