package proto; import java.util.ArrayList; import proto.BasePull.Company; public class BasePush { class Customer{ Company off; String add; public Company getOff() { return off; } public void setOff(Company off) { this.off = off; } public String getAdd() { return add; } public void setAdd(String add) { this.add = add; } } class Company{ String add; ArrayList<Customer> cus = new ArrayList<>(); public String getAdd() { return add; } public void setAdd(String add) { this.add = add; update(); } private void update() { for(Customer c:cus) { c.setAdd(add); } } } }