If there is no Strong reference being held to the old leaf object in the code, then it is eligible for garbage collection and will be cleaned up by the Garbage Collector.
Example 1 :
Employee emp1 = new Employee("John Doe"):
emp1 = new Employee("John");
// There is no strong reference to previously created Employee Object
// So its eligible for garbage collection
Example 2 :
Employee emp1 = new Employee("John Doe"):
emp2 = emp1;
emp1 = new Employee("John");
// In this case emp2 hold a strong reference to previously created Object
// so its not eleigible for Garbage collection
Note : A strong reference is a normal Java reference. For more info on different type of references refer the following article -Java - types of references