Refference variables and garbage collection

Hi, If we have two refference variables that are assigned to each other, both will reffer to the same object on the heap. But if we assign one of them to null after we have assigned it to the other variable, wll that object be subjected to garbage collection? Why would it be or would be not?

No, the object is not available for garbage collection until there are NO MORE references to it. This is a very key concept since it is easy to forget to null out all references when you are finished with an object.