package proto; import java.util.ArrayList; public class BasePush { class Customer { Company off; String add; public Customer() { Company_list.cus.add(this); } 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; } } static class Company_list { public static ArrayList<Customer> cus = new ArrayList<>(); } class Company { String add; public String getAdd() { return add; } public void setAdd(String add) { this.add = add; update(); } private void update() { for (Customer c : Company_list.cus) { c.setAdd(add); } } } }