Consider the following code:

public class CustomerList{
private List customers;
public delegate void ChangeHandler(CustomerList customers);
public event ChangeHandler ChangedList;
public CustomerList(){customers = new List();
}
public void Add(Customer c){customers.Add(c);
}
public static CustomerList operator + (CustomerList customers, Customer c) {
customers.Add(c);return customers;
}
}

As you can see, the CustomerList class overloads the binary + operator to make it easier for you to add Customer objects to a CustomerList object.
Now, write code that uses the += operator to add a Customer object named newCustomer to a CustomerList object named customers.

Respuesta :

Answer:

customers += newCustomer;

Explanation:

The operator += expands into + and assignment. The assignment is not overloaded so the required code is

customers += newCustomer;

This expands into

customers = customers + newCustomer;

The overloaded + operator is called for the right expression. This returns a `CustomerList`, which is then assigned through the = operator to `customers`.