Object A will also become eligible garbage collection as soon as you set ObjectB to null (* condition is ObjectA is not referred by any other live object).
This condition is known as "Island of Isolation".
Here is a nice explanation of this situation. (Here is one more explanation from SCJP book)